JS Language

Monday 14 May 2018

Learning A New Language

Define the following:

Parentheses

A parentheses is a space between brackets that defines what a function is and what the function is going to do. Example: var result = doSomething()

Square Brackets

The square brackets are used to access arrays. It's important to note that when accessing an array, the index counting starts at '0' instead of '1'. Example: ([0], [1], [2], [3])

Curly Braces

The curly braces are used in functions and used to add values to objects. They are seen at the start and end of functions. Example: function start () { ... }

Single Quotes

Single quotes are used to define strings in JavaScript. They can also be used inside of double quotes rather than having to use backslashes or escaping the quote all together.

Double Quotes

Double quotes are almost identical to single quotes except they can't be used to escape a quote and then return as single quotes can.