


And so what we can see is that splice actually does mutate the original array, so it takes part of the array and returns it and then the original array itselfloses this part that was extracted.





Reverse하면 arr2가 아예 바뀜
Concat = 합치는것



둘이 똑같은 결과

abs is absoulte value 절대값


foreach에서 파라미터 값 순서대로 (element ,index, array) 정의되어있음.

forEach With Maps and Sets

USD is Key , Unted states dollar is Value


afterbegin 8번부터
beforeend: 1번부터




--> same result.
const movementsUSD = movements.map(mov =>
mov * eurToUsd);



console result = stw

arrow function에 return이 있음.

forEach를 써야함 왜냐하면
because again, we do not want to create a new array,
we simply want to modify basically, the array that we get as an input.


And then on the other hand, the for each method, it was a great use case to produce some so called side effects.
So in other words, to simply do some work without returning anything.
And so that's what we did here, we simply looped over the accounts array, and in each iteration,
we manipulated the current account object, and edit a username to it based on the account owner,
plus all of these transformations that we had already done before.


both are same results

arrow function 쓰면 mov<0 은 return이 생략되어있음


0 is initial value

같은 결과 3840
acc = accumulator
최대값 : 3000

So now our accumulator is at 200 and the current movement is at 450.
So this one here is false again. And so now we return to movement as the new accumulator in the next iteration.
All right. And so in the next iteration, that accumulator is 450 now, then here, the current movement is minus 400.
And so here is 450 greater than minus 400.