Ultimate JavaScript Mastery - Part 1 Flashcards
What is JavaScript?
A programming language written to be executed within the browser
What can you do with JavaScript?
Modern JavaScript can also be used as a server side language as well as front end
Where does JavaScript code run?
Originally meant to run only in the browser, but can now be run outside the browser using node
Describe the difference between JavaScript and ECMAScript
ECMAScript is simply the standard for which JavaScript, a programming language, is written
Where should you place your tag within the browser?
The tag should be written at the end of the body section.
What is a statement?
A piece of code that expresses actions to be carried out.
Write a script tag
What are the data types in JavaScript?
Primitive (Value) Types and Data Types
Name the Primitive (Value) Types
String Number Boolean undefined null
Describe Dynamic Typing
JavaScript is a Dynamic Programmming language because variable types can be changed
Name the Reference Types
Object
Array
Function
What is an object?
A piece of code that stores data via key/value pairs. The keys are known as the properties of the object.
A key in an object is also known as what?
Property
What are the two ways to access properties within an object?
Dot Notation
ex. person.name = “Kevin”
Bracket Notation
ex. person[‘name] = “Kevin”
What are the names of the JavaScript operators?
Arithmetic - takes two operands and produces a new value (+, -, *, /, %, ++, –)
Assignment - assigns a value to a variable (=, +=)
Comparison - A comparison between to expressons that returns a boolean value such as ‘true’ or ‘false’ (>, >=,
Give an example of a ternary (conditional) operator
A ternary operator can evaluate an expression and provide two an option if it is true, and an option if false ex if(age >=21 ? "Old Enough" : "Too Young")
What are “falsy” values?
Any expression that evaluates to any of the following will return false.
undefined null 0 false "" NaN