-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray-Method.js
More file actions
25 lines (20 loc) · 741 Bytes
/
Copy pathArray-Method.js
File metadata and controls
25 lines (20 loc) · 741 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
// there are three tyepes of methods that are used in arrays.
// toString().
// valueOf().
// fill().
// toString() are sinmply coverts any type of Array into a sigle string.
// Note : After coverting it to a srting you will not be able to apply any array function or methods on it.
let ary = ["Muhammad","Shakri","Dev"];
ary.toString();
console.log(ary);
console.log(typeof(ary));
// ValueOf is default funciton of array to print all of its values.
let ary = ["Muhammad","Shakri","Dev"];
console.log(ary);
let ary1 = ["Muhammad","Haris"];
ary1.valueOf();
console.log(ary1);
//fill() is used to add a static values to the current array.
let ary = ["Muhammad Shakir","Muhammad Haris","Rehan Sattar"];
ary.fill("-Dev");
console.log(ary);