Skip to content

Commit 582965a

Browse files
committed
normal types
1 parent 6f2ed70 commit 582965a

File tree

2 files changed

+88
-11
lines changed

2 files changed

+88
-11
lines changed

sandbox.js

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
var character = 'mario';
2-
console.log(character);
3-
var inputs = document.querySelectorAll('input');
4-
inputs.forEach(function (input) {
5-
console.log(input);
6-
});
2+
var age = 30;
3+
var isBlackBelt = false;
4+
// character = 20;
5+
character = 'luigi';
6+
age = 40;
7+
isBlackBelt = true;
8+
var circ = function (diameter) {
9+
return diameter * Math.PI;
10+
};
11+
console.log(circ(7.5));
12+
// arrays
13+
var names = ['luigi', 'mario', 'yoshi'];
14+
// names = 'names';
15+
names.push('toad');
16+
// names.push(3);
17+
// names[0] = 3
18+
var numbers = [10, 20, 30, 40];
19+
numbers.push(25);
20+
// numbers.push('shaun')
21+
var mixed = ['ken', 4, 'chun-li', 8, 9, true];
22+
mixed.push(34);
23+
mixed.push('ryu');
24+
mixed[0] = 3;
25+
// objects
26+
var ninja = {
27+
name: 'mario',
28+
belt: 'black',
29+
age: 30
30+
};
31+
ninja.age = 40;
32+
ninja.name = 'ryu';
33+
// ninja.age = '30';
34+
// ninja.skills = ['fighting', 'sneaking'];
35+
ninja = {
36+
name: 'yoshi',
37+
belt: 'black',
38+
age: 40
39+
};

sandbox.ts

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,53 @@
1-
const character = 'mario';
1+
let character = 'mario';
2+
let age = 30;
3+
let isBlackBelt = false;
24

3-
console.log(character);
45

5-
const inputs = document.querySelectorAll('input');
6+
// character = 20;
7+
character = 'luigi';
8+
age = 40;
9+
isBlackBelt = true
610

7-
inputs.forEach(input => {
8-
console.log(input);
9-
});
11+
12+
const circ = (diameter: number) => {
13+
return diameter * Math.PI
14+
}
15+
16+
console.log(circ(7.5));
17+
18+
19+
// arrays
20+
let names = ['luigi', 'mario', 'yoshi'];
21+
22+
// names = 'names';
23+
24+
names.push('toad');
25+
// names.push(3);
26+
// names[0] = 3
27+
let numbers = [10, 20, 30, 40];
28+
numbers.push(25)
29+
// numbers.push('shaun')
30+
31+
let mixed = ['ken', 4, 'chun-li', 8, 9, true];
32+
33+
mixed.push(34);
34+
mixed.push('ryu');
35+
mixed[0] = 3;
36+
37+
// objects
38+
let ninja = {
39+
name: 'mario',
40+
belt: 'black',
41+
age : 30
42+
}
43+
44+
ninja.age = 40;
45+
ninja.name = 'ryu';
46+
// ninja.age = '30';
47+
// ninja.skills = ['fighting', 'sneaking'];
48+
49+
ninja = {
50+
name : 'yoshi',
51+
belt : 'black',
52+
age : 40
53+
}

0 commit comments

Comments
 (0)