Module 04-04 Introduction to Javascript Flashcards
What are the two words that can be used to declare a variable in JavaScript?
let (changeable) and const (immutable)
What does it mean that JavaScript is a loosely typed language?
It means that you don’t have to declare the datatype when initializing a variable
Can variables change datatypes in JavaScript?
Yes!
Does JavaScript use single or double quotes for strings?
Either, but it is best to use single
What method makes a string out of a number in JavaScript?
.toString()
How can you round to the nearest decimal point and convert to a string?
.toFixed(2) where 2 is the number of decimal points
How can you parse a string into a number?
.parseInt(string) or .parseFloat(string)
What is returned if a string can’t be parsed into a number?
NaN (not a number)
how is a placeholder represented?
${ }