Javascript Meaning Of Dot
Thanks gabriel for commenting and providing feedback.
Javascript meaning of dot. This is the syntax. Properties can t start with a number. When you do this you must include the name of the object.
When three dots occurs in a function call or alike it s called a spread operator and expands an array into a list. Below is my attempt to explain what do the three dots do in javascript. Hopefully this removes the fog around the.
The title of the article is from a question i was asked to answer on quora. This is an example of dot notation. 5 2 the dot syntax.
Below is my attempt to explain what do the three dots do in javascript. Javascript uses the dot syntax to separate the name of the object from its properties and methods. You can access properties on an object by specifying the name of the object followed by a dot period followed by the property name.
In javascript you refer to the methods and properties of an object using the dot syntax. When three dots is at the end of function parameters it s rest parameters and gathers the rest of the list of arguments into an array. Hopefully this removes the fog around the concept for people who will find this article in the future and have the same question.