Skip to content

Instantly share code, notes, and snippets.

@haingdc
Created March 13, 2018 04:53
Show Gist options
  • Save haingdc/ecef7920191d4c504035ea3a146d9aee to your computer and use it in GitHub Desktop.
Save haingdc/ecef7920191d4c504035ea3a146d9aee to your computer and use it in GitHub Desktop.
A Gentle Introduction to Functional JavaScript: Part 3
var ids = ['DEE', 'DUM'];
// (chưa cần hiểu bind vội) Mục đích là để thu được các thẻ DOM có id là “DEE”, “DUM”
var elements = map(document.getElementById.bind(document), ids);
// thêm tên class cho các thẻ DOM thu được
map(addClass, elements);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment