A Journey into the Abyss of Code

...follow the pink brick road...

❤ BLOGS HOME ❤ ❤ ABOUT ME ❤



JS Language


Explain to a non-tech friend

In the JavaScript language, describe all the use cases for each of:

Parentheses ( )
1. Execute an eventListener, so that something happens when you click your mouse or move the curser over certain areas on the webpage.
2. To write conditions inside a for loop, i.e. this condition has to be met for a certain action to be executed.
3. To execute a function, a function is an action that you want to make happen.

brackets [ ]
1. To create arrays

braces { }
1. To create objects, objects have properties and values so that another object can be easily replicated but still contain the same properties and the values can be customed for each new object quickly.
2. To group properties and values together when nesting inside an array.

single quotes ' '
1. To encase a string, which can be words or numbers.

double quotes " "
1. These are interchangeable and can be used in place of the single, they are useful to use and easier to read if you are encasing a 'quote' inside a double quote.