New library additions
#New string methods
"hello".repeat(3)
"hello". includes("ll")
"hello". startsWith("he")
"hello".padStart(8) // "hello"
"hello".padEnd(8) // "hello"
"hello".padEnd(8, '!') // hello!!!
"\u1E9B\u0323".normalize("NFC")
#New Number Methods
Number.EPSILON
Number.isInteger(Infinity) // false
Number.isNaN("NaN") // false
#New Math methods
Math.acosh(3) // 1.762747174039086
Math.hypot(3, 4) // 5
Math.imul(Math.pow(2, 32) -1, Math.pow(2, 32) -2) // 2
#New Array methods
//return a real array
Array.from(document.querySelectorAll("\*"))
//similar to new Array(...), but without the special single-argument behavior
Array.of(1, 2, 3)
Comments