Ch 2- Basic JS instructions Flashcards

1
Q

What is JavaScript at the most fundamental level?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain what you know about scoping and how that contributes to JS’ dynamic typing.

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the ways in which one can store data in JS?

A

Arrays, variables and objects are used to store data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How exactly is logical calculations carried out in JS?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly