-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathobject.js
More file actions
37 lines (28 loc) · 769 Bytes
/
object.js
File metadata and controls
37 lines (28 loc) · 769 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
30
31
32
33
34
35
36
37
const objectone = {
prop1: "value",
prop2: "another value ",
method1: function () {
console.log("a function inside an object is called a method");
},
}; // creating an instance/child of the global Object
// const keys = Object.keys(objectone);
// console.log(objectone);
const childobject = Object.create(objectone); // creating a child object of objectone
childobject.prop2 = "a new value";
childobject.prop3 = "child only property";
// console.log(childobject);
let newArray = [
"name",
"age",
9000,
["red", "blue"],
{ val: "value", color: "yellow" },
68373,
6262,
];
// yellow ---- newArray[4].color
console.log(newArray.length);
let name = "Albert";
console.log(name);
console.log(newArray);
// array methods, and string methods