Module-2 Flashcards
What is a client?
Hardware or software requesting functionality or services.
What is a server?
Hardware or software that provides functionality and services to clients.
What http method does the browser issue to a web server when they visit a url?
GET method.
What are three things on the start-line of an HTTP request message?
HTTP method, the request target, and HTTP version.
What are three things on start line of the response message?
Protocol version, a status code, a status text.
What are HTTP headers?
They allow the client and server pass additional information.
Is a body required for a valid HTTP request or response message?
No.
What is Ajax
AJAX is a technique that loads data into part of a page without having to refresh.
What does Ajax acronym stand for?
Asynchronous JavaScript and XML
Which object is built into the browser for making HTTP requests in JS?
XMLHttpRequest
What event is fired by XMLHttoRequest objects when they are finished loading the data from the server?
onLoad.
What is code block? What are some examples of a code block?
Code block are the code inside of curly braces. For example, functions, if and for statements.
What does block scope mean?
Block scope means local scope. Inside the curly braces.
What is the scope of a variable declared with const and let?
Const and let variables are block scope.
What is the difference between let and const?
The variables declared by let are mutable, and const are not mutable.
Why is it possible to push() a new value into a const variable that points to an Array?
Arrays are mutable.
How should you decide on which type of declaration to use?
If you intend to change the variable at some point, then use let, and if you don’t intend to change the variable then use const.
What is the syntax of writing template literals?
Enclosing the string statement with backticks.
What is string interpolation?
Substituting parts of a string with values of a variable or expression.
What is destructuring, conceptually?
Destructuring an object or array, and assigning one or more properties or indexes to individual variables.
What is the syntax for object destructuring?
The object name is on the right side of the initializer, with the const or let var on the left, followed by an opening bracket followed by the variable names of the indexes of the destructured array.
What is the syntax for Array destructuring?
The array name is on the right side of the initializer, with the const or let var on the left, followed by an opening bracket followed by the variable names of the indexes of the destructured array.
How can you tell the difference between destructuring and creating Object/Array literals?
destructuring has the curly braces before the assignment operator and Object/Array literals have the curly braces after the assignment operator.
What is the syntax for defining an arrow function?
The parameters are before the arrow, followed by either a statement within code block, or an expression which does not need to be within a code block. If code block is used then the return keyword needs to be specified.