Section 1

Preview this deck

What must a variable begin with?

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

6 years ago

Date created

Mar 14, 2020

Cards (44)

Section 1

(44 cards)

What must a variable begin with?

Front

A letter, $ or _

Back

Define: Objects

Front

Custom datatypes with properties and actions

Back

console.log(THING_TO_OUTPUT)

Front

A built-in JavaScript function that will push messages to the browsers error console. It is a very useful tool for debugging code, for seeing how variables are changing in your code. You can output strings, numbers, variables, objects, arrays and combinations of these for inspection.

Back

How do you add JS To your site internally?

Front

Internally using html <script></script> tag. Best practice to place it before closing body tag .

Back

Define: DOM

Front

Document Object model.

Back

Example of Conditional IF Statement

Front

if (This condition is true) {Do this thing} var Country = "Australia"; var Hemisphere, var Language; if (country = "England") { hemisphere = "northern"; language = "english"; }

Back

Define: First Class Function

Front

Treats functions as first class citizens - you can do with functions everything you can do with other elements.

Back

Conditionals

Front

Statements that allow for code to be executed against conditionals IF, ELSE statements

Back

While Loop Example

Front

Iterate while the condition is true while (condition) { do this thing }

Back

What will an undeclared variable return?

Front

Undefined

Back

Define: Operators

Front

Used to assign values to variables and add them together.

Back

Three main types of Loops

Front

For: Set Number of Iterations While: Certain conditions are met Do...While: Certain condition is met

Back

How do you add JS to your site externally?

Front

Add by externally linking to .js files.

Back

For Loop Example

Front

Repeats until a specific condition becomes false

Back

Define: JS Statement

Front

A command that tells the browser what to do. document.write("hello world"); var myName="lorna";

Back

Example of comparison operators

Front

var num = "5"; var numString ="5", ==Interpreted Value num ==numString (true) ===Interpreted value and data type num===numString(false)

Back

Define: Prototype Based

Front

Each object has a prototype that it inherits properties and abilities from

Back

Define: Boolear

Front

True or False

Back

Example of Conditional ELSE Statement

Front

Else statements allow us to make an alternative statement if original condition is false if (this condition is true){ ...do this thing }else{ ...do this other thing }

Back

What is DOM?

Front

Representation of HTML Page....

Back

What is Variable "Hoisting"?

Front

Variables are hoisted to the top of the function/statement. It is useful because you can refer to variables declared later in the code.

Back

Two types of variable scope?

Front

Local and Global

Back

Define: Dynamic Typing

Front

Dynamic if the type of variable is interpreted at runtime.

Back

What is best practice regarding variable declarations?

Front

Put variable declarations close to the top of the scope as possible.

Back

Is JS case sensitive?

Front

Yes

Back

Function Example

Front

function sayHello(){ alert ("hello everyone!"); }

Back

Function

Front

Re-useable blocks of instructions that can be executed by name. -Perform common tasks -saves time, reduces error function functionName (data) { repeat action here return outcome }

Back

Are variables case sensitive?

Front

Yes

Back

Define: Array

Front

Used to store multiple values in a single variable. Real ["blue", "5", "123456"] Refer to the whole array using its variable name Arrays are indexed from 0

Back

What are the 2 types of Numbers within Datatypes?

Front

Integer: Whole Number (-1, 450) Float:Decimal Point (0.1, 12.454)

Back

What are the two ways to add JS to your site?

Front

Internally and Externally.

Back

CONCEPT 1. What is a variable?

Front

Container for a piece of data

Back

Define: Loops

Front

Repetitive Conditional statements. Used to perform a calculation a number of times, or to iterate over a set of variables.

Back

What are the properties of Global Scope?

Front

Outside a function, available to any code outside that function (also within).

Back

Math Based Operators

Front

Back

How do you declare variables?

Front

using the var keyword - eg. var myName="Monica";

Back

CONCEPT 2. Datatypes

Front

Numbers, Strings, Boolear, Array, Objects.

Back

Define: Multi Paradigm Language

Front

Supports more than one programming paradigm - developers can work with a variety of styles within javascript.

Back

Math.random()

Front

Generates a random floating point number between 0 & 1. To convert this to a number range that we want - for example a random number between 1 & 10. First we multiply the result of Math.random() by 10 (the amount of potential numbers from 1 to 10) - this will give us numbers that range from 0 to 9.99999. Because Math.random() won't ever return the whole number 1 and to remove the decimal places, we use Math.ceil()to round the result of Math.random()*10 up to the nearest whole number. See more on the Math object.

Back

Comparison Operators

Front

Back

Define: Strings within Datatypes?

Front

A line of text "frog" "a red truck"

Back

Can a statement be grouped into useable blocks called functions?

Front

Yes.

Back

What are the properties of a Local Scope?

Front

Within a function, only available within function

Back

Do While Loop

Front

Iterate while the condition is true do { ... this thing } while(condition);

Back