The trim() method removes whitespace from both ends of a string. Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.).
Correct.
Meanwhile i have read some things and from what i understand,object is mutated, trying to keep rest of the object by using …spread operator. Don’t understand it quite much
map returns a new array, and if you write an object literal (graph parenthesis with key value pairs inside) then you are also creating a new array for each element of the array, nothing is mutated