Logo

Programming-Idioms

History of Idiom 169 > diff from v87 to v88

Edit summary for version 88 by programming-idioms.org:
Restored version 86: OT

Version 87

2021-03-22, 04:19:53

Version 88

2021-03-22, 08:59:02

Idiom #169 String length

Assign to integer n the number of characters of string s.
Make sure that multibyte characters are properly handled.
n can be different from the number of bytes of s.

Idiom #169 String length

Assign to integer n the number of characters of string s.
Make sure that multibyte characters are properly handled.
n can be different from the number of bytes of s.

Variables
n,s
Variables
n,s
Extra Keywords
size characters chars number runes
Extra Keywords
size characters chars number runes
Code
const n = s.length;
var a =b;
Code
const n = s.length;
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length