DEV Community

Discussion on: Quick JavaScript Tip: the some() method

Collapse
 
jecsham profile image
Jecsham

Nice post!

A strange example 😅:

// check for types! in this case, check if your array has a number
["str", "str2", {key: 3}, 5].some(x => typeof x === "number"); // true
["str", "str2", {key: 3}, "5"].some(x => typeof x === "number"); // false