-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathjavascript.js
59 lines (44 loc) · 1004 Bytes
/
javascript.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var Sales = "Toyota";
function CarTypes(name) {
if (name == "Honda") {
return name;
} else {
return "Sorry, we don't sell " + name + ".";
}
}
var car = { myCar: "Saturn", getCar: CarTypes("Honda"), special: Sales };
console.log(car.special);
// ES6 ---------------------------
const templateString = `${car.myCar} is a ${Sales} yay`;
const obj = {
[myKey]: 'val',
method(x, y) {
return x ** y;
},
...(foo ? obj1 : obj2)
}
class MyClass extends BaseClass {
constructor(...args) {
super(...args);
this.foo = args.foo;
}
fooMethod(bar = 'defaultValue', { items, baz: qux, ...rest, }) {
this.arr = [...items];
return this.arr.map(x => x * 2);
}
}
// 2. Tests ----------------------
return {
restrict: 'E',
transclude: true,
transclude: false,
scope: {
options: '='
},
templateUrl: 'js/...',
controllerAs: 'vm',
bindToController: true,
controller: function (NgTableParams, TABLE_OPTIONS_FIELD) {
var vm = this;
}
};