CS50
Search algorithm
- Linear Search : it is a method for finding an element within a list. it sequentially checks each element of the list until a match is found or the whole list has been searched.
- Binary Search : a.k.a half-interval search. it finds the position of a target value within a sorted array. it compares the target value to the middle element of the array.
Udemy
forEach() vs map()
both forEach() & map() create loop but I didn't know what the differences are. but today I had a Angela's lecture and got to know what are those! since forEach does not return anything, we need to make an array to push the result in. However, map doesn't need to do so since it automatically returns an array.
Β