![]() Note 2: if b is a very large array, this method is discouraged, because. Normally I would create a new array maintaining immutability. Note 1: in my opinion the array mutation should only be used in performance-critical applications, such as high FPS animations, to avoid creating new arrays. The a array's content will be entirely replaced by b content. It could be also useful to replace the entire content of an array, using a.length (or Infinity) in the splice length: let a = Ĭonsole.log(a) // ->, which is the content of b ![]() In ES6 with a single operation, you can do this to replace the first b.length elements of a with elements of b: let a = ![]()
0 Comments
Leave a Reply. |