UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

16 lines (15 loc) 624 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.strtoupper = strtoupper; function strtoupper(str) { // discuss at: https://locutus.io/php/strtoupper/ // parity verified: PHP 8.3 // original by: Kevin van Zonneveld (https://kvz.io) // improved by: Onno Marsman (https://twitter.com/onnomarsman) // example 1: strtoupper('Kevin van Zonneveld') // returns 1: 'KEVIN VAN ZONNEVELD' if (typeof str === 'undefined') { throw new Error('strtoupper() expects exactly 1 argument, 0 given'); } return (str + '').toUpperCase(); }