JAVASCRIPT LANGUAGE
Technical Blog
14.APR.2016
In the JavaScript language, describe all the use cases for each of:
Parentheses () - Parentheses have multiple use cases in Javascript, here are cases I am aware of.
1. Control structure of if, for, while statements.
2. Define function parameters.
3. Grouping expressions and parameters.
4. Some functions have no parameters so the space between parentheses is blank.
Brackets [] - Brackets are used as access operators for array classes and elements.
Braces {} - Curly braces are used to define the beginning and end of functions and statement blocks like if() and for() structures.
Single quotes ' ' - Placing text inside quotation marks turns that text into a string. Strings is the way Javascript handles and processes text.
Double quotes " " - Double quotes are the same as single quotes which are used to create strings that contain text. From what I have read there is no difference between single and double quotes other than user preference. For example it may be easier to read your code if you place single quotes on the outer strings and double in the inner strings.