Convert Array-like to True Array

object,array,tipjs

This is cool! Learning something new @wesbos ES6 course 🔥

const nodeList = document.querySelectorAll('ul li');

// Method 1: Convert to true Array
Array.from(nodeList);

// Method 2: Convert to true Array
[...nodeList];

// Now you can use map and other methods to loop

Có thể bạn đã miss một số snippets code

serialize Form

Sử dụng formdata constructor để convert form, FormData, array.from(). Kết hợp window.encodeURIComponent() để encode từng value trong form.

lỗi access-control-allow-origin và cách khắc phục

lỗi access-control-allow-origin và cách khắc phục trong express, nodejs

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

group by property javascript use reduce

group by property javascript use reduce

Random String

Random String với độ dài tuỳ chọn