You do not even need to emphasize:
body.tags.forEach(function(t) { t.tag = t.tag.toLowerCase();});
map (whether native, underscore or others) is used to convert integer values, this is not a typical use case to do what you tried to do with it. Also, using a simple for may work better, since you don't need function calls here, but it depends on optimizing the runtime.
By the way, if you replace the matching function with the function from this answer and donβt set the return value to body.tags , you will also get the desired result.
source share