Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. Array.prototype.uniq = function() {
  2. return [...new Set(this)]
  3. }
  4.  
  5. Array.prototype.asyncMap = async function(func) {
  6. const data = []
  7.  
  8. for (let item of this) {
  9. data.push(await func(item))
  10. }
  11.  
  12. return data
  13. }
  14.  
  15. Array.prototype._concat = function() {
  16. return this.reduce((prev, next) => prev.concat(next), [])
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement