loading
open in
main.js
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
var x = 'JavaScript';
console.log(x.length);
console.log(x.indexOf('S'));
console.log(x.substring(4));

// Equivalent String object, which behind the scenes calls String.toString() 
var y = String('JavaScript');

if (x == y) { 
  console.log('x == y is True');
} else {
  console.log('x == y is False');
}

if (x === y) { 
  console.log('x === y are True');
} else { 
  console.log('x === y are False');
}

// Explicitly creates an object of a 'primitive' data type with 'new'
var z = new String('JavaScript');

if (x == z) { 
  console.log('x == z is True');
} else {
  console.log('x == z is False');
}

if (x === z) { 
  console.log('x === z is True');
} else {
  console.log('x === z is False');
}
Native Browser JavaScript