Nice to meet you, ma fren 🫡. Sorry, I ain't DEVing that much ✍️ , primarily due to the nature of maintaining Open Source projects 👷, while also gigging 💰. Anyways, stay humble like a bumblebee 🐝.
Awesome tutorial! I just want to highlight an important ES6 feature you might find helpful. In modern JavaScript, you no longer need to explicitly type the word "function" when defining functions inside objects. It is also cross-browser compatible 1. So, your example can be simplified like this:
constperson={name:'John',greet(){console.log(this.name);// 'this' points to the 'person' object}};person.greet();// Output: John
The ES6 feature you've mentioned is known as "method shorthand," and it indeed simplifies the process of defining functions inside objects. Thanks for sharing this valuable information!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Awesome tutorial! I just want to highlight an important ES6 feature you might find helpful. In modern JavaScript, you no longer need to explicitly type the word "function" when defining functions inside objects. It is also cross-browser compatible 1. So, your example can be simplified like this:
You can learn more about this feature in the Mozilla Developer Network documentation: developer.mozilla.org/en-US/docs/W... ↩
The ES6 feature you've mentioned is known as "method shorthand," and it indeed simplifies the process of defining functions inside objects. Thanks for sharing this valuable information!