UNPKG

locutus

Version:

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

14 lines (13 loc) 447 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.length = length; function length(str) { // discuss at: https://locutus.io/powershell/length/ // parity verified: PowerShell 7.4 // original by: Kevin van Zonneveld (https://kvz.io) // example 1: length('Hello') // returns 1: 5 // example 2: length('') // returns 2: 0 return String(str).length; }