Last active
February 6, 2022 21:31
-
-
Save YasirGaji/c2246bf99b16bdf85f391414602114ce to your computer and use it in GitHub Desktop.
This script demonstrates object literals in arrow functions for the "Arrow Functions in Javascript" article by Yasir Gaji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OBJECT LITERAL WITH ARROW FUNCTION EXPRESSION. Undefined result | |
const obj = () => { name: 'Yasir Gaji' } | |
console.log(obj()); | |
// OBJECT LITERAL WITH ARROW FUNCTION EXPRESSION. Success result | |
const ect = () => ({ | |
name: 'Yasir Gaji', | |
age: 19, | |
}); | |
console.log(ect()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment