Array、Stringはlength
Set、Mapはsize で取得できる
// Array.length
[1,2,3,4,5].length // 5
// String.length
'hoge'.length // 4
// Set.proptotype.size
new Set([1,2,3,3,3,3]).size // 3
// Map.prototype.size
new Map([[0, 'a'], [1, 'b']]).size // 2
Go to list of users who liked
More than 5 years have passed since last update.
Array、Stringはlength
Set、Mapはsize で取得できる
// Array.length
[1,2,3,4,5].length // 5
// String.length
'hoge'.length // 4
// Set.proptotype.size
new Set([1,2,3,3,3,3]).size // 3
// Map.prototype.size
new Map([[0, 'a'], [1, 'b']]).size // 2
Register as a new user and use Qiita more conveniently
Go to list of users who liked