@jgCarroll/

JSONdata

JavaScript

A common interview question.

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// source encodeURIComponent
const myJsonObj = {
  myString: [some string],
  myNumber: [some number],
  myNull: [null],
  myBoolean: [false],
  myUndefined: [undefined],
  myArray: [some array],
  myFunction: [some function],
  myObject: [some object]
};

// Answer

const myJsonObj = {
  "myString": "fuck off",
  "myNumber": 69,
  "myNull": null,
  "myArray": ["you suck", "fuck you", "eat shit"],
  "myBoolean": false,
  "myObject": { 
    "name": "Jim",
    "age": 54,
    "city": "Springfield"}
};
Native Browser JavaScript