Week 7 - Web Flashcards

1
Q

What does it mean when it is said that a function in JavaScript is ‘first class’?

A
  • they may be assigned
  • they may be stored in variables, arrays and objects
  • may be passed as parameters to other functions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What types are passed by value in JS?

A

strings
numbers
booleans

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What types are passed by reference in JS?

A

object
function
array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a lambda function?

A

a syntactically
compact alternative to a regular function
declarations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the prototype property do?

A

permits the addition of new properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What allows access to the DOM at the client side?

A

The JavaScript DOM API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the global object when JS is executing in a browser?

A

window in which the execution occurs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the Navigator class include?

A
  • name of the browser
  • platform
  • human language of browser
  • if cookies are enabled
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where do most of the objects in the DOM inherit from?

A

Node class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the parent to the tag?

A

document object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What properties does the Document object have?

A

doctype - from header
implementation - the actual implementation object
documentElement - the element for HTML docs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does JSON stand for?

A

Javascript Object Notation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is JSON?

A

syntax for storing and exchanging data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Give some elements of JSON syntax?

A
  • data is in name value pairs
  • data is separated by commas
  • curly braces hold objects
  • square brackets hold arrays
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the types in JSON?

A
string
number
object
array
boolean
null
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Commonalities between JSON and XML?

A
  • both are self describing hierarchical data structures
  • both can be used in XMLHTTPRequests
  • both programming language independent formats
17
Q

Differences between JSON and XML?

A
  • XML is more complex to parse
  • JSON has better fit with JavaScript
  • Schema in XML is more sophisticated
18
Q

What is a WebSocket?

A

something which provides full-duplex communication
over a TCP connection between a web browser (or
other program) and a web server

19
Q

How are WebSockets made possible?

A

by providing a standardised way for the server to send content to the client without first being first requested by the client

20
Q

Events in WebSocket?

A
  • on open
  • on error
  • on close
  • on message