@@ -85,7 +85,7 @@ const newarr13 = arr13.slice(1, 3); // [2, 3]
8585const newarr20 = arr13 . slice ( 1 ) ; // [2, 3, 4, 5]
8686console . log ( newarr13 ) ;
8787
88- // Array splice Method splice(index, howmany , "new value", Delete ) changes in the exesting array
88+ // Array splice Method splice(startIndex, deleteCount , "new value", item1, item2 ) changes in the exesting array
8989const arr14 = [ 1 , 2 , 3 , 4 , 5 ] ;
9090arr14 . splice ( 2 , 0 , 6 , 7 ) ;
9191arr14 . splice ( 2 , 1 , 8 , 9 ) ;
@@ -106,7 +106,6 @@ const prices = [4, 8, 9, 10, 12];
106106const newPrices = prices . map ( ( price , i , arr ) => {
107107 return price * 0.5 ;
108108} )
109-
110109console . log ( newPrices ) ;
111110
112111
@@ -223,15 +222,3 @@ const findProducts = myProducts.find((elem) => {
223222} )
224223
225224console . log ( findProducts ) ;
226-
227-
228-
229- // NOTE: Final summary Table for (find, filter, reduce, forEach, map)
230- /*
231- Method Creates a New Array? Returns a Single Value? Original Array Modified?
232- .map() ✅ Yes ✅ Yes (returns a new array) ❌ No
233- .filter() ✅ Yes ✅ Yes (returns a new array) ❌ No
234- .reduce() ❌ No ✅ Yes (returns a single value) ❌ No
235- .find() ❌ No ✅ Yes (returns a single element) ❌ No
236- .forEach() ❌ No ❌ No (returns undefined) ✅ Yes (can modify original array)
237- */
0 commit comments