[js] if there is no variable to receive the return value of map, where will the return value of map be put?

In a case like this, where will the return value of the map function be put? Is it also saved in memory?
arr.map (item= > {

)
return item*2

})

Mar.29,2021

will get the value of the expression. If there is no reference, there will be garbage collection


return value, but you can't find it. After execution, it will be treated as garbage collection directly. It won't be saved.


returned values are not garbage collected, only overwritten. Function return values are usually stored in specific registers, for example, return value types less than 32 bits will be stored in eax, even if you do not use it, the return value will still be in eax, and this value will not be recovered, but other subsequent operations may use eax to store new values, and the return value of the last function will be overwritten. This is not a garbage collection mechanism!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4593d-43e9e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4593d-43e9e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?