What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-20 16:39:02
javascript rest parameters vs spread operator
/** * JS Spread and Rest operators: * Two operators with the same syntax (...) but behave differently */ // Rest parameter: collects all remaining elements into an array. function foo (...args) { console.log(args) } foo(1,2,3,4,5,6) // Output: (6) [1,... Add solution -
Other 2021-09-12 09:24:02
compare two arrays and remove not matched objects
If you're looping over array1 with i = 0, len = array1.length; i < len; i++, but within the loop you remove an entry from array1 what do you think happens on the next loop? You also appear to be removing things that are found, but your question say yo... Add solution
Best helpers
Ranking is empty