Advertisement
pharmokan

es6 common leetcode topics of usage javascript

Apr 14th, 2020
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. unique from arr
  2. unique from arr and arr2 (in arr but not in arr2, in arr2, but not in arr)
  3. unique in arr that is not in arr2
  4.  
  5.  
  6. same from arr
  7. same in arr and arr2
  8.  
  9. remove in arr that are in arr2
  10. remove in arr that are not in arr2
  11.  
  12. filter in arr that are in arr2
  13. filter in arr that are not in arr2
  14.  
  15. add to arr items that are in arr2 but not in arr
  16.  
  17. arr contains arr2[i]
  18.  
  19. funcs
  20. ---
  21. toString
  22. parseInt
  23. math.max.apply
  24. math.min.apply
  25. typeof
  26. math.abs
  27.  
  28.  
  29.  
  30. misc concepts
  31. ---
  32. counter
  33. -Infinity
  34. pointer
  35. is empty
  36. obj keys
  37. obj entries
  38. array index
  39. array value
  40. ternary short-hand
  41.  
  42.  
  43.  
  44. loops
  45. ---
  46. for in
  47. for of
  48. for i
  49. while
  50. break or i-- i++
  51.  
  52. conditions
  53. ---
  54. if
  55. then
  56. else
  57. unless
  58. or
  59. isnt
  60. is
  61. true
  62. false
  63. == | ===
  64. null | undefined | '' | 0 | [] | {}
  65.  
  66.  
  67.  
  68.  
  69. array
  70. ---
  71. length
  72. map
  73. reduce
  74. filter
  75. sort
  76. pop
  77. indexOf
  78. findIndex
  79. unshift
  80. splice
  81. push
  82. reverse
  83. join
  84. split
  85. fill
  86. concat
  87. every
  88. some
  89. includes
  90. swap
  91. empty array (a = [])
  92. spread
  93. matrix
  94. for i
  95. for j
  96.  
  97.  
  98. strings
  99. ---
  100. includes
  101. regexp
  102. match
  103. test
  104. replace
  105. swap
  106. split
  107. join
  108.  
  109.  
  110.  
  111. objects
  112. ---
  113. entries
  114. values
  115. spread
  116. has value
  117. key exists
  118. assign if key not exist
  119. pick
  120. omit
  121.  
  122.  
  123.  
  124. misc
  125. ---
  126. new Map
  127. new Set
  128. new Object
  129. new Array
  130. Set as array
  131. Object as Set?
  132. Object as Map
  133.  
  134.  
  135.  
  136. set
  137. ---
  138. has
  139. add
  140. delete
  141. to Array
  142. iterate
  143.  
  144.  
  145.  
  146. map (like obj)
  147. ---
  148. size
  149. get
  150. set
  151. has
  152. delete
  153. keys
  154. values
  155. next
  156. iterate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement