How to return object literals from arrow functions in JavaScript

added by JavaScript Kicks
9/18/2019 8:01:43 AM

374 Views

Why you might accidentally get an undefined value returned from a function when trying to return an object literal. Do you know the what is returned from the following? Here's a hint: The issue with the arrow function is that the parser doesn't interpret the two braces as an object literal, but as a block statement.


0 comments