Ch 2- Basic JS instructions Flashcards
What is JavaScript at the most fundamental level?
JavaScript represents the behavioral layer of web development within a progressive enhancement paradigm/model of web development.
JS is a series of statements, ending typically in semicolons which add functionality to a website. Behavioral code is made up principally of functions, methods, objects, other data types, if-else statements, do/while statements, loops, arrays all while utilizing several forms of DOM traversals and manipulations.
Code blocks are lines of code entered within curly braces, typically used in for-else statements.
Behavioral code is made principally of:
functions,
objects,
methods,
other data types,
if-else statements,
loops and loop statements
(while L, do-while L, for L, for-in L, break S, continue S),
arrays,
all while utilizing several forms of DOM traversals
and manipulations.
Explain each of the 10 exampels given above.
Functions: code that returns a value when called.
Objects: hold data-value pairs.
Methods: functions inside objects.
Other data types: U SNNOB
(undefined, string, null, number, obj, boolean)
If-else statements: deal with conditions that evaluate to T or F.
loops: Used to run same code over and over again.
Arrays: ordered listing of objects
http://www.dofactory.com/tutorial/javascript-loops
Explain what you know about scoping and how that contributes to JS’ dynamic typing.
…
What are the ways in which one can store data in JS?
Arrays, variables and objects are used to store data.
How exactly is logical calculations carried out in JS?
Logical calculations are carried out in JS in the same way as they are in anything else, generally with simple Arithmetic.
JS expressions and operators are used to create if-else statements for example.