-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray_join.js
More file actions
37 lines (29 loc) · 809 Bytes
/
Copy patharray_join.js
File metadata and controls
37 lines (29 loc) · 809 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 array1=[1,2,3,'My','Name','is','Ney']
console.log(array1)
// [ 1, 2, 3, 'My', 'Name', 'is', 'Ney' ]
const string1=array1.join()
console.log(string1)
// 1,2,3,My,Name,is,Ney
const string2=array1.join('')
console.log(string2)
//123MyNameisNey
const string3=array1.join(',')
console.log(string3)
// 1,2,3,My,Name,is,Ney
const string4=array1.join('and')
console.log(string4)
// 1and2and3andMyandNameandisandNey
console.log("=========================");
const string5=array1.join('-')
console.log(string5)
// 1-2-3-My-Name-is-Ney
const string6=array1.join('=')
console.log(string6)
// 1=2=3=My=Name=is=Ney
const string7=array1.join(':')
console.log(string7)
// 1:2:3:My:Name:is:Ney
const string8=array1.join(' ')
console.log(string8)
// 1 2 3 My Name is Ney
console.log("=========================");