JavaScript new Keyword
As we have used new keyword multiple times before
A new keyword is used to create new objects, In other words, we use new keyword to provide new memory to the class by creating new objects.
Now we will see an Example of new Keyword -
Example 1 -
Output
Yellow
Sweet
10
Example 2 -
Output -
100
200