Skip to content

Commit

Permalink
Merge pull request #8 from Malhar-Soomro/malhar
Browse files Browse the repository at this point in the history
introduction of arrow function through code
  • Loading branch information
iamzaidsoomro authored Oct 19, 2021
2 parents 95e19cc + f030bf6 commit fd5107b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arrowFunction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function regular() {
// returning object
return { name: "john" }
}
let returnedValue = regular()
// printing object returned by regular function
console.log(returnedValue);

// same code written in arrow function
let arrow = () => ({ name: "john" });
returnedValue = arrow();
console.log(returnedValue);

0 comments on commit fd5107b

Please sign in to comment.