What do you want to save?
Add Code snippet
New code examples
-
-
Javascript 2021-10-05 19:02:05
codebyte-intersection-challenge
function FindIntersection(){ //1) Grab the first and second elements to be compared let firstString = strArr[0] let secondString = strArr[1] //2) Create empty arrays to store elements, after converted from strings to numbers let firstElementArray =... Add solution -
-
-
-
Javascript 2021-09-27 05:26:04
update object in array if id exists else append javascript
function upsert(array, item) { // (1) const i = array.findIndex(_item => _item.id === item.id); if (i > -1) array[i] = item; // (2) else array.push(item); } const array = [ {id: 0, name: 'Apple', description: 'fruit'}, {id: 1, name: 'Bana... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5