locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
10 lines (9 loc) • 396 B
JavaScript
export function upcase(str) {
// parity verified: Ruby 3.3
// discuss at: https://locutus.io/ruby/String/upcase/
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Returns a copy of str with all lowercase letters replaced with uppercase.
// example 1: upcase('hELLo')
// returns 1: 'HELLO'
return (str + '').toUpperCase();
}