Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

Intro to JavaScript

QuestionAnswer
What do variables do? hold reusable data in a program and associate it with a name
You can reassign a variable with "let"? True
const variables can be reassigned? False
How to interpolate values? Using backticks `` and ${}
What does the typeof keyword do? returns the data type (as a string) of a value
What does an If statement do? checks a condition and will execute a task if that condition evaluates to true
What does an If Else Statement do? make binary decisions and execute different code blocks based on a provided condition
How can you add more conditions to an If Else statement? By using Else If statements
what is this comparison operator "<"? Less than
what is this comparison operator ">"? More than
what is this comparison operator "<="? Less than or equal to
what is this comparison operator ">="? Greater than or equal to
what is this comparison operator "==="? Is equal to
what is this comparison operator "!=="? Is not equal to
what is this logical operator "&&"? And
what is this logical operator "||"? Or
what is this logical operator "!"? Not
Examples of Falsy data values 0 , "" , null, undefined, NaN
Example of a Ternary Operator isCorrect ? console.log('Correct!') : console.log('Incorrect!');
What is a Ternary Operator? Shorthand to simplify concise If Else statements
What is the use of Switch Statements? To simplify the process of writing multiple Else If statements
What does the "break;" do stops the remaining cases from being checked and executed
Example of a Switch Statement let athleteFinalPosition = 'first place'; switch (athleteFinalPosition){ case "first place" : console.log("You get the gold medal!"); break; default: console.log("No medal awarded.") break; }
Example of an Else If statement let stopLight = 'yellow'; if (stopLight === 'red') { console.log('Stop!'); } else if (stopLight === 'yellow') { console.log('Slow down.');} else { console.log('Caution, unknown!'); }
Example of a Ternary Operator let isNightTime = true; if (isNightTime) { console.log('Turn on the lights!'); } else { console.log('Turn off the lights!'); }
Define Function a reusable block of code that groups together a sequence of statements to perform a specific task
Define Parameter a named variable inside a function’s block which will be assigned the value of the argument passed in when the function is invoked
Example of calling a function in code greetWorld();
Example of function expressions const calculateArea = function (width,height) { const area = width * height; return area; }
Example of Arrow Function notation const calculateArea = (width, height) => { const area = width * height; return area; }
Example of single-block concise functions const sumNumbers = number => number + number;
Example of multi-block concise functions const sumNumbers = number =>{ const sum = number + number; return sum;
Define Scope Where variables can be accessed through the program & determined by where & how they are declared
Define Block Statements that exist within {}
Define Global Scope Context within which variables are accessible to every part of the program
Define Global Variables Exist within the global scope
Block Scope Context within which variables are accessible, only within the block they are defined
Define Local Variables Exist within the block scope
Define Global namespace Space in our code that contains globally scoped info
Scope pollution Too many variables exist in a namespace or variables names are reused
Define Arrays Lists that store data in JS created with []
Each item inside of an array is at a numbered position, or index, starting at 0 True or False? True
Example of accessing an Array myArray[0]
Example of changing an item in an array myArray[0] = "new string"
How to see how many items in an Array Using the .length property
Arrays cant be nested inside other arrays. False
Purpose of Loops Perform repetitive actions so we don't have to manually process the code every time
Example of a For Loop for (let counter = 0; counter < 4; counter++) { console.log(counter); }
Example of Looping through an Array const animals = ['Grizzly Bear', 'Sloth', 'Sea Lion']; for (let i = 0; i < animals.length; i++){ console.log(animals[i]); }
Define Nested Loop A loop running inside another loop
Example of a Nested Loop const myArray = [6, 19, 20]; const yourArray = [19, 81, 2]; for (let i = 0; i < myArray.length; i++) { for (let j = 0; j < yourArray.length; j++) { if (myArray[i] === yourArray[j]) { console.log('Both arrays have the number: ' + yourArray
Examples of a Do While Loop let counterTwo = 1; while (counterTwo < 4) { console.log(counterTwo); counterTwo++; }
Example of a Do While Statement let cupsOfSugarNeeded = 10 let cupsAdded = 0 do { cupsAdded++ console.log(cupsAdded + ' cup was added') } while (cupsAdded < cupsOfSugarNeeded);
Purpose of Do While loops Allow for different types of stopping conditions
Created by: ShahedAli02
Popular Engineering sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards