Tag:iteration
-
Summary of common ES6 tips [de duplication, exchange, merge, inversion, iteration, calculation, etc.]
This article describes the common skills of ES6 with examples. The details are as follows: 1-array de duplication var arr = [1,2,3,4,3,4]; var arr2 = […new Set(arr)]; At this time, arr2 is the array after de duplication~ 2-exchange the values of two variables let [x,y] = [1,2]; [y,x] = [x,y]; console.log(y); 3 – get a […]
-
Summary of ruby iterator knowledge
In short: iteration refers to doing the same thing repeatedly, so iterator is used to repeat the same things many times. Iterators are collection supported methods. Objects that store a set of data members are called collections. In ruby, arrays and hashes can be called collections. Iterators return all elements of the collection, one after […]
-
Leetcode430. Flatten a Multilevel Doubly Linked List
Topic Requirements You are given a doubly linked list which in addition to the next and previous pointers, it could have a child pointer, which may or may not point to a separate doubly linked list. These child lists may have one or more children of their own, and so on, to produce a multilevel […]