Advertisement
thanhnb

array in js

Aug 26th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. array in js
  2. - map: // duyệt qua mảng cũ, thay đổi giá trị của item focus và trả về 1 mảng mới
  3. array1.map(e=>{
  4. if(e.id != action.id) return e;
  5. return {...e, thuoctinh: abc};
  6. })
  7.  
  8. - concat://nối 2 mảng với nhau
  9. array1.concat(array2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement