You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- create an array to hold objects in javascript. Each object should store a "Code" as in an number and "Descrip" as a string. The array should hold all of the objects. Create objects for the following HTTP status codes:
3
2
4
-
StatusOK = 200
3
+
Create an array to hold objects in javascript.
4
+
5
+
Each object should store a "Code" as in a number and "Descrip" as a string.
6
+
7
+
The array should hold all of the objects. Create objects for the following HTTP status codes:
5
8
9
+
StatusOK = 200
6
10
StatusMovedPermanently = 301
7
11
StatusFound = 302
8
12
StatusSeeOther = 303
9
13
StatusTemporaryRedirect = 307
10
-
11
14
StatusBadRequest = 400
12
15
StatusUnauthorized = 401
13
16
StatusPaymentRequired = 402
14
17
StatusForbidden = 403
15
18
StatusNotFound = 404
16
19
StatusMethodNotAllowed = 405
17
20
StatusTeapot = 418
18
-
19
21
StatusInternalServerError = 500
20
22
21
-
- stringify that data to JSON
23
+
Stringify that data to JSON
22
24
23
-
- display that JSON in the browser window
25
+
Display that JSON in the browser window
24
26
25
27
IN A GO FILE
26
-
- Create a variable with the identifier "rcvd" of type string. Store a raw string literal of the JSON created in the previous step as the value of the variable "rcvd".
27
28
28
-
- Unmarshal "rcvd" into a data structure with the identifier "data"
29
+
Create a variable with the identifier "rcvd" of type string.
30
+
31
+
Store a raw string literal of the JSON created in the previous step as the value of the variable "rcvd".
32
+
33
+
Unmarshal "rcvd" into a data structure with the identifier "data"
34
+
35
+
Use a for range loop to iterate through "data" displaying the results to the terminal
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
29
49
30
-
- use a for range loop to iterate through "data" displaying the results to stdout
0 commit comments