JS Flashcards
To improve retention of core JavaScript concepts
What is the command line?
Program in the computer that allows you to issue direct commands to the computer
What is scope?
How accessible a variable is within your script
What is a code block?
Anything within { }, except an object
Local scope versus Global scope
In local scope, can access variables declared locally and globally. In global scope, can only access global variables
What is data?
Data is a sequence of characters or symbols on which operations are performed by a computer
What’s a data type?
Extra info about data that tells the computer how to deal with it and how to store it.
What’s a program?
A series of instructions that perform a task, executed by a computer
What are the data types of JavaScript?
1) string 2) number 3) boolean 4) null 5) undefined
6) object (a complex data type)
Which value in JS is not strictly equal to itself and why?
NaN. Because NaN is like an undefinable number. NaN is unordered. It is not equal to, greater than or less than anything, including itself
Loosely typed language means what?
JS is loosely typed in that it guesses what each data type is. JS does not require type declaration
What is an API?
Application Programming Interface. It facilitates communication between a client and a server
What is a server?
A computer program or device that accepts and responds to requests made by another program, often a client. A server manages network resources
What is a client?
The opposite of a server. The thing that sends a request to a server
What is a REST API?
REST is Representational State Transfer. A REST API follows a specific architectural style in how the data stored is arranged and how the API communicates with clients
JSON and how it differs from JS.
JavaScript Object Notation. It has all the JavaScript data types except functions.
What is Cache?
Hardware or software used to store something, often temporarily
What is HTTP?
Hypertext Transfer Protocol. Its a set of rules through which browsers and servers communicate on the web
What is an endpoint?
An API term. It’s the URL that points to the data in the API
AJAX
Asynchronous JavaScript and XML. It’s a set of techniques using different web technologies on the client side to run asynchronous processes
Asynchronous
Not at the same time. When something in the program is operating independently of other processes
What are ‘props’ in react?
A prop is a property on a react element, and is represented as an object of its own properties which include the element’s content (children) and attributes like ‘id’, ‘src’, etc.
Syntax parser
A program that reads your code and determines what it does, what it contains, and if its grammar is valid
Lexical environment
It’s where something sits physically in the code. When lexical environment matters, it means that where you write something (eg. a variable) matters to the syntax parser.
Execution context
A wrapper to help manage the code that is actually running
An object
In JS, it’s a collection of name-value pairs.
Global
Not inside a function
What are the characteristics of Var?
Var declarations are 1) function scoped. They can be accessed anywhere within the function 2) can be redeclared with a new value 3) hoisted to the global object with the value of undefined.
What are the characteristics of let?
1) Is block scoped {}. Only available and declared within the block. 2) can be reassigned ( actor = “chris pratt”) but NOT redeclared in the same scope (let actor = “ethan hawke”) 3) hoisted, but just the variable name - no value is provided unless you set one
What are the characteristics of const
1) Block scoped (as is let). 2) Cannot be redeclared or reassigned. 3) If its an object however, the properties can be updated or reassigned
What’s Babel?
It is an open source program that allows you to write ES6 code that is then made backwards compatible with older browsers
What’s webpack?
It’s a bundler (or module builder) based in JavaScript that figures out all the dependencies in your code then puts together a minimalist version that can be plugged into your HTML file and run.
The DOM
The DOM is an API for HTML (and XML documents). The DOM is a structural representation of your HTML document that allows you to interact with the document using JavaScript
What are falsy values. Is an empty array truthy or falsey?
A falsy value in JS is a value that is considered ‘false’ when evaluated in a Boolean context.
The JS falsy values are: 0, null, undefined, “ “, false, NaN.
Everything else is truthy, including an empty array and empty object