-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobj.js
More file actions
29 lines (21 loc) · 642 Bytes
/
obj.js
File metadata and controls
29 lines (21 loc) · 642 Bytes
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
26
27
28
29
'use strict'
/*
* Create an object `obj` that has a property for each primitive values
* much like in primitive.js
*
* @notions Functions, Operators
* @next circular
*/
// Your code :
//* Begin of tests
const assert = require('assert')
assert.strictEqual(typeof obj, 'object')
assert.strictEqual(typeof obj.str, 'string')
assert.strictEqual(obj.str, '1337')
assert.strictEqual(typeof obj.num, 'number')
assert.strictEqual(obj.num, 42)
assert.strictEqual(typeof obj.bool, 'boolean')
assert.strictEqual(obj.bool, false)
assert.strictEqual(typeof obj.undef, 'undefined')
assert.strictEqual(obj.undef, undefined)
// End of tests */