serialize Form

tipjs,object,es6

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

const serializeForm = form =>
  Array.from(new FormData(form), field => field.map(encodeURIComponent).join('=')).join('&');
// Sử dụng
serializeForm(document.querySelector('#form')); // email=test%40email.com&name=Test%20Name

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

jQuery on hover

Jquery on mouse over example.

Converting Object to an Array

Converting Object to an Array

Đếm số phần tử trong mảng JavaScript

Đếm số lần xuất hiện của các phần tử trong mảng JavaScript

Merge Array

How to combine two sorted arrays into one? We can do this easily with the spread operator.

Remove array of objects from another array of objects

Remove array of objects from another array of objects