JavaScript Flashcards
(54 cards)
Minimal Viable Product (MVP)
the simplest version of an app that a developer can share with users to receive feedback
how do you link a JS file?
within the script tag
where do you place the script tag?
at the very bottom of the html file, before the closing
why is the JS linked at the bottom of the page?
when the browser sees a tag, it will immediately run the JS file preventing from moving onto the next html tag
what is window.alert (“ “)?
alert window popup
what is a function?
predefined action that we can call or invoke in our code (after we declare it earlier in the code)
what does “passing an argument” mean?
placing content between the parentheses in a function
what is an expression?
each piece of code, separated by semicolons
how do you declare a function?
use the keyword function, followed by the name we want to give it
what is the code between curly braces ({ }) called?
code block
what does it mean to “call a function”?
telling the computer to run or execute that set of actions
what do you need to do to allow a function to work?
call the function
what is this an example of?
function fight ( ) { window.alert (" "); }
fight ( );
calling a function
what is user input?
info that a user enters into a program
what does this function do?
window.prompt (“ “)
a window pops up with an area for the user to input data
what is a variable?
named location for a value that gets stored in the browser’s memory when a program is run
how does the browser capture the data entered into a prompt by a user?
adding variables
what is this an example of?
var playerName = window.prompt (“ “)
a variable. we give the data a variable name (playerName) allowing us to refer to it consistently by just calling on that name
var keyword
whenever this keyword is used it tells the program that we are creating a new variable and the next word is going to be the name of the variable
what is a variable name?
the actual name that will store the info assigned to the variable - the browser will store this name to recall later in the program
what is camel casing?
only use with two worded names - the first word is lower case with the first letter in the second word being capitalized
what is an assignment operator?
(=) used to set the value to a variable name
what is a string data type?
sting of text - must be wrapped in “ “
what is number data?
a whole number or decimal