-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.js
More file actions
54 lines (37 loc) · 727 Bytes
/
sample.js
File metadata and controls
54 lines (37 loc) · 727 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* @flow */
import bar from './zzz2';
// import foo2 from './zzz3';
function foo( bar:string, coo:number ):Array<string> {
console.log( 'bbb' );
return ['tada'];
}
class Too {
t1 = '00';
constructor(){
this.t1 = 'ttt';
}
}
// foobar
var k = foo( 33, 'a22' );
// var m = bar( 33, 'a22' );
// console.log( 'd' );
function barr(x) {
return x*10;
}
barr("Hello, world!");
function lent(x) {
return x.length;
}
var total = lent("Hello") + lent(null);
function total(numbers: Array<number>) {
var result = 0;
for (var i = 0; i < numbers.length; i++) {
result += numbers[i];
}
return result;
}
total([1, 2, 3, "Hello"]);
function coo(x) {
return x.length;
}
var res = coo("Hello") + coo(42);