Javascript basics
Test your JS: http://jsbin.com
Setting up variables:
Declaring - set the name.
Assigning - set the value.
Glossary/Dictionary:
Statements - Executable line of code. Eg. var www = $('.selector').attr(“src”, “https://example.com”);
Expression - Produces a value or is a value. Parts of larger statements. Eg. The function in this statement. $('.selector').on( 'click', function () {}
);
Keywords - A set of words with reserved functionality in JS. Eg. var, function, etc.
Index - The position or order of a value in an Array.
Javascript Data types:
- Boolean - eg: true, false
- Strings - eg: 'string_name' JS Strings
- Numbers and NaN - JS Numbers Page
- Objects - JS Objects
- Symbols - JS Symbols
- Arrays - JS Arrays
Operators:
Functions
Methods
DOM (Document Object Model)
DOM traversal - moving from a node to its parent, children, or siblings nodes.
Traversing Upwards (parent):
.parentNode
.parentElement
Traversing to children:
1.) Any Node type: ( .childNodes, .firstChild, .lastChild )
2.) Element Nodes: ( .children, .firstElementChild, .lastElementChild, .childElementCount )
https://codepen.io/jimboobrien/pen/BJaaNz
Traversing to Siblings:
1.) Any Node type: (.nextSibling, .previousSibling )
2.) Element Nodes: (.nextElementSibling, .previousElementSibling )