Json

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

1.

schema

2.

$schema

3.

JsonSchema

4.

JSONschema

Q 1 / 80

Json

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

'red', 'blue', 'green' ] json json json { "color": "red", "color": "blue", "color": "green" } json { "red": "red", "blue": "blue" }

1.

[ 'red', 'blue', 'green' ]

2.

json ["red", "blue", "green"]

3.

json ["red", "blue", "green"]

4.

json { "color": "red", "color": "blue", "color": "green" }

5.

json { "red": "red", "blue": "blue" }

Q 2 / 80

Json

Which JavaScript method converts a JavaScript value to Json?

1.

JSON.parse()

2.

JSON.stringify()

3.

JSON.toString()

4.

JSON.objectify()

Q 3 / 80

Json

Which data type is NOT part of JSON standard?

1.

string

2.

number

3.

date

4.

array

Q 4 / 80

Json

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

1.

unpacking

2.

serialization

3.

deserialization

4.

parsing

Q 5 / 80

Json

Which code uses the correct JSON syntax to encode the key/value pair shown?

`accountNum: '000605802'`

1.

"accountNum": "000605802"

2.

accountNum: "000605802"

3.

"accountNum": 000605802

4.

accountNum: 000605802

Q 6 / 80

Json

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?

1.

`/`

2.

``

3.

`:`

4.

`{`

Q 7 / 80

Json

Which date type is part of the JSON standard?

1.

Boolean

2.

map

3.

promise

4.

function

Q 8 / 80

Json

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

1.

important

2.

base

3.

core

4.

required

Q 9 / 80

Json

Which is the valid JSON equivalent of the data shown?

{ 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], } } json { "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] } } json { "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] } } json { "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] } } json { "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"] } }

1.

json { "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] } }

2.

json { "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] } }

3.

json { "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] } }

4.

json { "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"] } }

Q 10 / 80

Json

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

1.

Escape all whitespaces expect space characters.

2.

Escape line breaks.

3.

Escape paragraphs.

4.

Remove all whitespaces

Q 11 / 80

Json

What data type is represented by the value of the key/value pair shown?

`loggedIn: true`

1.

string

2.

Boolean

3.

number

4.

object

Q 12 / 80

Json

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

1.

"loggedIn": (true)

2.

loggedIn: "true"

3.

"loggedIn": true

4.

loggedIn: {true}

Q 13 / 80

Json

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

1.

an `<origin>` element

2.

a header request

3.

the `<script>` element

4.

the XMLHttpRequest object

Q 14 / 80

Json

Which value is supported in the JSON specifications?

1.

undefined

2.

infinity

3.

NaN

4.

null

Q 15 / 80

Json

Which JavaScript method converts JSON to a JavaScript value?

1.

JSON.parse()

2.

JSON.stringify()

3.

JSON.toString()

4.

JSON.objectify()

Q 16 / 80

Json

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.

1.

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

2.

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

3.

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

4.

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

Q 17 / 80

Json

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

json { "host": "Atlanta", "year": 1996 /_ Centennial Olympics _/ } json { "host": "Atlanta", "year": 1996, /_ Centennial Olympics _/ } json { "host": "Atlanta", "year": 1996 // Centennial Olympics } json { "host": "Atlanta", "year": 1996, "comments": "Centennial Olympics" }

1.

json { "host": "Atlanta", "year": 1996 /_ Centennial Olympics _/ }

2.

json { "host": "Atlanta", "year": 1996, /_ Centennial Olympics _/ }

3.

json { "host": "Atlanta", "year": 1996 // Centennial Olympics }

4.

json { "host": "Atlanta", "year": 1996, "comments": "Centennial Olympics" }

Q 18 / 80

Json

Can trailing commas be used in objects and arrays?

1.

yes

2.

only if there is more than one item

3.

no

4.

only when arrays and objects contain more than 10 items

Q 19 / 80

Json

Which whitespace characters should be escaped within a string?

1.

All whitespace is allowed.

2.

double quotes, slashes new lines, and carriage returns

3.

new lines and carriage returns only

4.

double quotes only

Q 20 / 80

Json

Which is supported by YAML but not supported by JSON?

1.

nested

2.

comments

3.

arrays

4.

null values

Q 21 / 80

Json

Which is an invalid JSON value?

1.

`"'|=(_)(X 72(_)|/||*'"`

2.

`"|=(_)(X 72(_)|/||*"`

3.

`"|=(_)(X" "72(_)|/||*"`

4.

`"s(_)(X 72(_)|/||*"`

Q 22 / 80

Json

How do you encode a date in JSON?

1.

Convert the date to UTC and enclose in quotes.

2.

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

3.

Wrap the date in double quotes.

4.

Add a "date" key to your object and include the date as string.

Q 23 / 80

Json

What’s wrong with this JavaScript?

`JSON.parse({"first": "Sarah", "last": "Connor"}) ;`

1.

JSON should be wrapped with curly braces.

2.

JSON.parse() is missing an argument.

3.

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

4.

Nothing is wrong with it.

Q 24 / 80

Json

What does this JavaScript code print?

js 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'); } not null null not null null null not null not null null null null null null

1.

A

2.

B

3.

C

4.

D

Q 25 / 80

Json

What tool might you use to validate your JSON?

1.

JSONLint

2.

ValidateJSON

3.

JSONFiddle

4.

TextEdit

Q 26 / 80

Json

What characters denote strings in JSON?

1.

double quotes

2.

smart (curly) quotes

3.

single or double quotes

4.

single quotes

Q 27 / 80

Json

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

1.

`"constant": "6.022E23"`

2.

`"constant": "6.022E23"`

3.

`constant: 6.022E23`

4.

`constant: "6.022E23"`

Q 28 / 80

Json

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

1.

`<object>`

2.

`<script>`

3.

`<json>`

4.

`<meta>`

Q 29 / 80

Json

Why do so many APIs use JSON?

1.

Because it's object-based.

2.

Because it's a simple and adaptable format for sharing data.

3.

Because it's based on JavaScript.

4.

Because it is derived from SGML.

Q 30 / 80

Json

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' ] } json { "avengers": ["iron man", "hulk", "thor", "black widow", "ant man", "spider man"] } json { 'avengers': [ {'iron man', 'hulk', 'thor', 'black widow', 'ant man', 'spider man'} ] } json { "avengers": ["iron man", "hulk", "thor", "black widow", "ant man", "spider man"] } json { "avengers": {[ "iron man", "hulk", "thor", "black widow", "ant man", "spider man" ]} }

1.

A

2.

B

3.

C

4.

D

Q 31 / 80

Json

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

1.

XML

2.

GRAPHQL

3.

REST

4.

SOAP

Q 32 / 80

Json

How is a true boolean value represented in JSON?

1.

TRUE

2.

"true"

3.

1

4.

true

Q 33 / 80

Json

Which array is valid JSON?

1.

['tatooine', 'hoth', 'dagobah']

2.

[tatooine, hoth, dagobah]

3.

["tatooine", "hoth", "dagobah",]

4.

["tatooine", "hoth", "dagobah"]

Q 34 / 80

Json

What data type is encoded in the outermost component of the JSON shown?

json { "year": 2024 }, { "location": "unknown" } ]

1.

object

2.

array

3.

number

4.

string

Q 35 / 80

Json

Which is ignored by JSON but treated as significant by YAML?

1.

trailing commas

2.

trailing decimals

3.

whitespace

4.

leading zeroes

Q 36 / 80

Json

When you need to set the value of a key in JSON to be blank, what is the correct syntax for the empty value?

1.

FALSE

2.

0

3.

""

4.

null

Q 37 / 80

Json

How do you assign a number value in JSON?

1.

Escape the number with a backslash.

2.

Enclose the number in double quotes.

3.

Enclose the number in single quotes.

4.

Leave the number as is.

Q 38 / 80

Json

Which code uses the correct JSON syntax for encoding a key/value pair with a null value?

Note: None of the above options appear to be correct. A correct answer would be `"lastVisit": null`

1.

"lastVisit": "null"

2.

lastVisit: null

3.

"lastVisit": 0

4.

"lastVisit": undefined

Q 39 / 80

Json

Which reference to the Unicode character U+1F602 complies with the JSON standard?

1.

128514

2.

d83dde02

3.

uD83DuDE02

4.

&#128514;

Q 40 / 80

Json

Which code uses the correct JSON syntax for a key/Value pair containing a string?

1.

"largest": "blue whale"

2.

largest: 'blue whale'

3.

'largest': 'blue whale'

4.

largest: "blue whale"

Q 41 / 80

Json

Which key name is used to specify data type in a JSON schema?

1.

data

2.

schemadata

3.

schematype

4.

type

Q 42 / 80

Json

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

**NONE OF THESE ARE CORRECT A CORRECT ANSWER WOULD LOOK LIKE `"UPC": "043875"`**

1.

"UPC": 043875

2.

UPC: "043875"

3.

"UPC": 043875

4.

UPC: '043875'

Q 43 / 80

Json

Which data format is a JSON schema written in?

1.

markdown

2.

YAML

3.

XML

4.

JSON

Q 44 / 80

Json

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

1.

"variance": "-0.0823"

2.

variance: "-0.0823"

3.

"variance": "-0.0823"

4.

variance: -0.0823

Q 45 / 80

Json

With what character should key/value pairs be separated?

1.

colon

2.

space

3.

semicolon

4.

comma

Q 46 / 80

Json

What character separates keys from values?

1.

:

2.

->

3.

::

4.

.

Q 47 / 80

Json

If a string contains line breaks, what should you do?

1.

Wrap line breaks in single quotation marks

2.

Make no changes, because whitespace is allowed

3.

Replace any line breaks with `r`

4.

Replace any line breaks with `n`

Q 48 / 80

Json

Which number types are available in javascript but not supported in json?

1.

Fractional and Transcendental

2.

Infinity or Rational

3.

Rational and Irrational

4.

Infinity or NaN

Q 49 / 80

Json

How should a date value be stored in JSON?

1.

As a string with quotes

2.

As a string without quotes

3.

As a string in ISO 8583 format

4.

As a string in ISO 8601 format

Q 50 / 80

Json

Is the JSON code shown here valid?

![JSON object with key "Vehicles" containing an array of emojis](images/Q51/Q51.jpeg)

1.

No, emojis must be escaped with a backslash.

2.

No, JSON strings are not allowed to use emojis.

3.

No, emojis should never be enclosed with double quotes.

4.

Yes, emojis are valid characters because JSON strings are unicode.

Q 51 / 80

Json

What data structure do you use to encode ordered information?

1.

list

2.

array

3.

struct

4.

indexed hash

Q 52 / 80

Json

What are valid values in JSON?

1.

arrays, strings, numbers, true/false

2.

hashes, arrays, strings, numbers, booleans, null

3.

arrays, objects, lists, strings, numbers, booleans

4.

objects, arrays, strings, numbers, booleans, null

Q 53 / 80

Json

Which key format is valid JSON?

1.

key: "value"

2.

"key": "value"

3.

key, "value"

4.

'key': 'value'

Q 54 / 80

Json

What data type is encoded in the outermost component of the JSON shown?

json { "result": [ { "year": 2024 }, { "location": "unknown" } ] }

1.

number

2.

array

3.

string

4.

object

Q 55 / 80

Json

What's wrong with this JSON object?

json { "series": "Star Trek", "episodes": "The Trouble with Tribbles" }

1.

Key/value pairs should be separated by semicolons.

2.

Keys should be enclosed with double quotes.

3.

Key/value pairs should always have a trailing comma.

4.

Keys and values should be enclosed with single quotes.

Q 56 / 80

Json

How should comments be formatted in JSON?

1.

Wrap the comments in single quotes and place it at the bottom of the file.

2.

Wrap the comments in double parentheses.

3.

Escape comments by placing two slashes at the start of the comment.

4.

JSON does not support comments.

Q 57 / 80

Json

How would you make the following string valid in JSON?

json "name": 'bb-8'

1.

name: "bb-8"

2.

"name": 'bb-8'

3.

"name": "bb-8"

4.

"name": bb-8

Q 58 / 80

Json

How are values separated in JSON?

1.

with brackets

2.

with colons

3.

with commas

4.

with parentheses

Q 59 / 80

Json

With which programming language is JSON best used?

1.

any language, as JSON is language agnostic.

2.

Ruby

3.

JavaScript

4.

Python

Q 60 / 80

Json

What values can arrays contain?

1.

only numbers

2.

any valid JSON value

3.

only strings and numbers

4.

only strings

Q 61 / 80

Json

What technique can be used to represent complex objects with JSON?

1.

reserialization

2.

nesting

3.

memorization

4.

minimization

Q 62 / 80

Json

What characters are used to enclose an array?

1.

[]

2.

{}

3.

""

4.

()

Q 63 / 80

Json

What is the official MIME type for JSON?

1.

text/json

2.

text/javascript

3.

application/json

4.

data/json

Q 64 / 80

Json

What character cannot be part of string within JSON without additional formatting?

1.

/

2.

"

3.

-

4.

:

Q 65 / 80

Json

Which data type is part of the JSON standard?

1.

function

2.

promise

3.

Boolean

4.

map

Q 66 / 80

Json

Which data type is not part of the JSON standard?

1.

number

2.

string

3.

array

4.

date

Q 67 / 80

Json

Which character separates keys from values?

1.

:

2.

->

3.

::

4.

.

Q 68 / 80

Json

What is the purpose of JSON?

1.

to provide a simple way to serialize and deserialize data between different sources

2.

to provide a way to store data for machine learning

3.

to provide an archival solution for data warehousing

4.

to provide a way for JavaScript to run other languages

Q 69 / 80

Json

Can you assume the order of keys in an object?

1.

No, but you can sort the keys with `JSON.sort()`.

2.

Yes, object keys are always ordered alphabetically.

3.

Yes, but only when the object is first parsed.

4.

No, you can never assume object keys will be in order.

Q 70 / 80

Json

With what character should object keys be enclosed?

1.

`*`

2.

`#`

3.

`^`

4.

`"`

Q 71 / 80

Json

What is the maximum number of key/value pairs that JSON supports?

1.

10,000

2.

1000

3.

There is no defined limit.

4.

1 million

Q 72 / 80

Json

What is the recommended term used to refer to multiple resources?

1.

a swarm

2.

multiple resources

3.

a collection

4.

a group

Q 73 / 80

Json

Does JSON support signed numbers?

1.

yes, but only if they are enclosed in quotes

2.

only with integers

3.

no

4.

yes

Q 74 / 80

Json

What two nonnumerical characters can numbers contain?

1.

dash and dot

2.

dash and comma

3.

comma and exclamation point

4.

dot and comma

Q 75 / 80

Json

What JavaScript method is used to load JSON data?

1.

JSON.ingest()

2.

JSON.convert()

3.

JSON.read()

4.

JSON.parse()

Q 76 / 80

Json

How are the values in an array separated?

1.

with right arrows

2.

with colons

3.

with semicolons

4.

with commas

Q 77 / 80

Json

What is the minimum number of values in an array?

1.

zero

2.

one

3.

two

4.

three

Q 78 / 80

Json

In JSON, a set of brackets ([]) is used to denote **_**, whereas curly braces ({}) denote **_**.

1.

arrays; objects

2.

objects; functions

3.

arrays; functions

4.

key/value pairs; arrays

Q 79 / 80

Json

How does JSON represent truth, falsity and nullness?

### Q81. Which character _cannot_ be part of string data within JSON without additional formatting? ### Q82. If an object key contains spaces, how can you access its value in JavaScript? ### Q83. When parsing JSON, "caching" is a method used to _. ### Q84. What is the only valid whitespace character within a string that does not require an escape character? ### Q85. What technique can you use to safely encode very large numbers? ### Q86. Which code is a valid JSON equivalent of the key/value pair shown that also preserves the data type? json variance: -0.0823 ### Q87. Based on the JSON object shown, which JavaScript code would you use to find out what is in this vehicle's glove box while assigning the glove box contents to a new variable? js myVehicleContents = { van: { inside: { 'glove box': 'maps', 'passenger seat': 'crumbs', }, exterior: { trunk: 'jack', }, }, }; js myVehicleContents.van.inside['glove box'] = gloveBoxContents; js var gloveBoxContents = myVehicleContents.van.inside['glove box']; gloveBoxContents; js var gloveBoxContents = myVehicleContents.van.glove box.contents; gloveBoxContents; js myVehicleContents.van.inside['inside'] = gloveBoxContents; ### Q88. What characters are used to define an object?

1.

true, false, null

2.

true, false

3.

TRUE, FALSE, NULL

4.

true, false, null

5.

/

6.

"

7.

:

8.

-

9.

Remove spaces from the key before accessing the value.

10.

Use dot notation to access the value.

11.

Use object key index to access the value.

12.

Use bracket notation to access the value.

13.

remove duplicate data from a server

14.

temporarily store data for faster access

15.

store excess information in chunks to be reviewed later

16.

clog up a web browser with useless information

17.

line break

18.

space

19.

tab

20.

return

21.

Store the number as a string

22.

Convert the number into an exponent.

23.

Round the number to the nearest 10-digit number.

24.

Split the number into smaller parts.

25.

variance: "-0.0823"

26.

variance: -0.0823

27.

"variance": "-0.0823"

28.

"variance": "-0.0823"

29.

A

30.

B

31.

C

32.

D

33.

||

34.

{}

35.

()

36.

[]

Q 80 / 80