GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — JavaScript/String/Upper.js at master · TheAlgorithms/JavaScript Expand file tree/ Copy pathUpper.jsMore file actions 19 lines (17 loc) · 482 Bytes / Copy pathUpper.jsFile metadata and controls19 lines (17 loc) · 482 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 /** * @function upper * @description Will convert the entire string to uppercase letters. * @param {String} str - The input string * @return {String} Uppercase string * @example upper("hello") => HELLO * @example upper("He_llo") => HE_LLO */ const upper = (str) => { if (typeof str !== 'string') { throw new TypeError('Argument should be string') } return str.replace(/[a-z]/g, (char) => String.fromCharCode(char.charCodeAt() - 32) ) } export default upper |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |