-
-
Imperative
- statements that change a program state
- C++, C#, Javascript
- lower level abstraction
- care about each incremental state change
-
Declarative
- what needs to be done
- css, json, html
- higher level abstraction
- only care about the final state
-
DOM
- Document Object Model
- is the way javascript sees HTML or XML
-
MIME
- Multipurpose Internet Mail Extension
- The format that HTTP tags each object being transported
- Web browser looks at the MIME type to see if it knows how to handle the object
-
URI
- Uniform Resource Identifier
- postal address of the internet
-
URL
- Uniform Resource Locator
- most common
- describes the specific location of a resource on a server
-
HTTP Transactions
consists of a request command and a response result
-
GET
Requests a representation of the specified resource
-
POST
- submits data to be process to the identified resource
- data is included in the body of the request
-
PUT
uploads a representation of the specified resource
-
DELETE
delete the named resource from a server
-
Status code
- 3 digit numeric code
- tells the client if the request succeeded or if other actions are required
-
HTTP Status codes 200, 302, 404
- 200 = OK
- 302 = Redirect
- 404 = Not found
-
3 parts of an HTTP Message
- Start Line - what to do(request) or what happened(response)
- Header Fields (optional) - name and value
- Body(optional) - carry data to and from web server
-
TCP/IP
- application layer protocol
- doesn't worry about details
-
TCP
- error free transportation
- in-order delivery
- transfer data in any size at any time
-
-
Default port for HTTPS
443
-
In javacript, how do you convert a number to an integer
Math.floor(number
-
What is NaN and how do you detect it?
- number value that is a result of an operation that cannot produce a normal result
- detect using isNaN(number)
-
4 parts of a function literal
- 1. reserved word function
- 2.function name (optional) no name = anonymous
- 3.parameters
- 4.set of statements wrapped in curly braces
-
Invocation
- invoking a function
- suspends the execution of the current function
-
4 invocation patterns
- Method
- Function
- Constructor
- Apply
-
Method Invocation Patter
- bound to the object
- use this to access the object
-
Function Invocation Pattern
- when a function is not the property of an object, then it is invoked as a function
- this is bound to the global object
-
Constructor Invocation Pattern
functions that are intended to be used by the new prefix
-
Apply Invocation Pattern
- apply method lets us construct an array of arguments to use to invoke a function
- 2 parameterss - this and and array of paramas
-
undefined
if the value is not specified then undefined is returned
-
closure
- functions that have access to variables from another function's scope
- created when you use a function inside another function
-
Array literal
a pair of square brackets surrounding zero or more values separated by commas
|
|