Section 1

Preview this deck

do

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

1 year ago

Date created

Mar 14, 2020

Cards (27)

Section 1

(27 cards)

do

Front

a variation of the while loop. Usage is do {} while(cond); This is slightly different from a while loop because it executes the statements inside the loop block AT LEAST ONCE see: while

Back

while

Front

see: do usage: while (condition) {} In this case, it is possible not to even go through the statements if the condition evaluates to false

Back

new

Front

this is an operator. The new keyword is used to create an instance of an object. It calls a constructor function

Back

function

Front

keyword to declare a function block in JS

Back

with

Front

Extends the scope chain for a statement usage: with (object) { // statements; } MDN however, does not recommend the use of the with keyword

Back

break

Front

to get out of loops. Use it (sparingly) inside for or while loops used also inside switch statements to prevent cascading of flow. see: switch, for, while, continue

Back

catch

Front

part of a try-catch-finally exception handling mechanism. When an exception is thrown, the actual exception can be matched to a number of catch blocks. If the exception matches, the program flow is transferred to that catch block see: try, finally

Back

void

Front

This is an operator. If you are coming from a statically typed language, don't mistake this for a type. JavaScript has dynamic typing, so you won't use void in there. It evaluates an expression, then it returns undefined. usage: void expression;

Back

delete

Front

this is an operator. You will use it to delete defined properties on an object example: delete object.property delete object['property']

Back

try

Front

Used for handling exceptions or abnormal runtime conditions. usage: try {} catch(exception) {} finally {} It alters program flow during cases of abnormal runtime conditions. Statements inside the try are the ones that can potentially trigger an exception see: catch, finally

Back

continue

Front

similar to the break statement. It is used inside loops. The difference is that, in the case of the label, it does immediately get out of the loop. It forces program flow to the beginning of the loop to allow evaluation of the loop condition; the break keyword does not do that, break just gets out of the loop see: break, for, while

Back

default

Front

used as part of a switch statement. After a series of case labels has been evaluated, if none of them matches the expression, the statements under the default label will be executed see: switch, case

Back

return

Front

It specifies the value of what is to be returned from a function usage function goo() { ... return value; } see: function

Back

in

Front

used as an iterator. It can step through a number of enumerated properties usage: for (variable in object) { ... }

Back

if

Front

a branching keyword. It executes a statement or a block of statement if the condition evaluates to true usage if(cond) {} else if() {} else if() {} else {} see: else, else if

Back

throw

Front

To programmatically raise an Exception. To manually trigger an abnormal runtime condition usage: throw "Error MESSAGE"; throw -1; see: try, catch, finally

Back

debugger

Front

invokes any available debugging functionality, if any is available. There isn't any clear examples I've seen on this one though. Even Mozilla Developer Network lacks concrete examples

Back

else if

Front

see: if, else

Back

finally

Front

part of a try-catch-finally block. see: try Statements inside the finally block are executed regardless of whether an exception occurred or not

Back

this

Front

Used in OOP constructions. Generally, the this keyword refers to instance of oneself, but it behaves differently in JS than in other languages like Java or C# MDN has more information on this https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/this

Back

else

Front

an optional block used hand in hand with the if block. In a situation where in the expression on the if statement evaluates to false, an else block can be provided

Back

case

Front

used from within a switch statement. It works as an expression matcher. When an it matches, program flow is routed on that specific case label see: switch

Back

instanceof

Front

this is an operator. Use it to test whether an object is a descendant (is kind of) another object usage: obj1 instance of obj2 child instance of parent

Back

var

Front

keyword to declare a variable. If you don't use var for declaration, the variable becomes part of the global scope

Back

typeof

Front

This is an operator. It returns a string indicating the type of the given operand usage: var i = "ABC"; console.log(typeof i);

Back

switch

Front

A branching mechanism. Similar to IF but it uses CASE labels instead of blocks see: if, case

Back

for

Front

creates a loop. It usually has 3 parameters inside it 1) beginning value 2) condition when to terminate and 3) step, whether increment or decrement These 3 parameters are optional. They are separated by semi colon see: while, do

Back