Linkiden Flashcards

1
Q

By convention, what name is used for the first key in a JSON schema?

A

$schema

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

Which code is the closest JSON equivalent of the data shown?

A
{
    "color": "red",
    "color": "blue",
    "color": "green"
  }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which JavaScript method converts a JavaScript value to Json?

A

JSON.stringify()

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

Which data type is NOT part of JSON standard?

A

date

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

Which term is commonly used to refer to converting data to JSON

A

serialization

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

Which code uses the correct JSON syntax to encode the key/value pair shown?
accountNum: ‘000605802’

A

“accountNum”: “00060504”

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

What character do you specify before a JSON control character when you want to use that control characters as a literal part of a string?

A

\

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

Which date type is part of the JSON standard?

A

Boolean

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

Which key name is used to specify properties that must be included for JSON to be valid?

A

required

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

Which is the valid JSON equivalent of the data shown? *** MISSING OPTIONS & “DATA SHOWN”

A
{
  	"photo": {
  	"width": "1600",
  	"height": "900",
  	"binaries": {
  	"url": "https://www.example.com/images/34097349843",
  	"thumbnail": "https://www.example.com/images/thumbs/34097349843"
  	},
  	"animated": "false",
  	"tags": ["116", "943", "234", "38793"],
  	}
  }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you store several paragraphs of text as a string in JSON?

A

Escape all whitespaces expect space characters.

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

What data type is represented by the value of the key/value pair shown?
<code>loggedIn: true<code></code></code>

A

Boolean

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

If you need to store the loggedin status of a user in JSON as a boolean, what is the correct syntax?

A

“loggedIn”: true

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

What does JSON with padding (JSON-P) use to make a request?

A

the element

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

Which value is supported in the JSON specifications?

A

null

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

Which JavaScript method converts a Json to JavaScript value?

A

JSON.parse()

17
Q

Transferring JSON information from client to server and back again often includes HTTP requests. Match each method with the best choice describing its use.

  1. Sends data to specific server to create or update information.
  2. Sends data to specific server to create or update information without the risk of creating the resource more than once.
  3. Previews what the GET request response might be without the body of the text.
  4. Learns the communication channels used by the target source.
  5. Requests information from a specific source.
  6. Removes information.
A

1.POST 2.PUT 3.HEADER 4.OPTIONS 5.GET 6.DELETE

18
Q

Which code uses valid JSON syntax for the text “Centennial Olympics?

A
{
"host": "Atlanta",
"year": 1996,
"comments": "Centennial Olympics"
}
19
Q

Can trailing commas be used in objects and arrays?

A

no

20
Q

Which whitespace characters should be escaped within a string?

A

new lines and carriage returns only

21
Q

Which is supported by YAML but not supported by JSON?

A

comments

22
Q

Which is an invalid JSON value?

A

“\s()(X 72()|/||*”

23
Q

How do you encode a date in JSON?

A

Encode the date as string using the ISO-8601 date format.

24
Q

What’s wrong with this JavaScript?

JSON.parse({“first”: “Sarah”, “last”: “Connor”}) ;

A

The value supplied to JSON.parse() is not a string.

25
Q

What does this JavaScript code print?
printNullness(JSON.parse(‘{ “lemmings”: [] }’));
printNullness(JSON.parse(‘{ “lemmings”: null }’));
printNullness(JSON.parse(‘{ “lemmings”: “null” }’));

function printNullness(){
  if (testMe.lemmings == null)
    console.log("null");
  else
    console.log("not null");
}
A

not null null not null

26
Q

What tool might you use to validate your JSON?

A

JSONLint

27
Q

What characters denote strings in JSON?

A

double quotes

28
Q

Which code is a valid JSON equivalent of the key/value pair shown that also preserves the data type?

A

“constant”: “6.022E23”

29
Q

Which element is added to the DOM to create a JSON-P request?

A
30
Q

Why do so many APIs use JSON?

A

Because it’s based on JavaScript.

31
Q

You need to assemble a list of members, but your JSON is not parsing correctly. How do you change it?
{ “avengers”: [ “iron man”, “hulk”, “thor”, “black widow”, “ant man”, “spider man’ ] }

A

{ “avengers”: [ “iron man”, “hulk”, “thor”, “black widow”, “ant man”, “spider man” ] }

32
Q

When building dynamic web applications using AJAX, developers originally used the ____ data format, which has since been replaced by JSON.

A

XML

33
Q

How is a true boolean value represented in JSON?

A

“true”