Skip to content

Commit ea242bf

Browse files
committed
typed arrays example
1 parent 23c8ea8 commit ea242bf

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

chapter02/07-TypedArrays.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="07-TypedArrays.js"></script>
9+
</body>
10+
</html>

chapter02/07-TypedArrays.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
let length = 5;
2+
let int16 = new Int16Array(length);
3+
4+
let array16 = [];
5+
array16.length = length;
6+
7+
for (let i=0; i<length; i++){
8+
int16[i] = i+1;
9+
}
10+
11+
console.log(int16);
12+
13+
14+
//Int8Array();
15+
//Uint8Array();
16+
//Uint8ClampedArray();
17+
//Int16Array();
18+
//Uint16Array();
19+
//Int32Array();
20+
//Uint32Array();
21+
//Float32Array();
22+
//Float64Array();
23+
24+
25+
//http://www.html5rocks.com/en/tutorials/webgl/typed_arrays/
26+
//http://www.i-programmer.info/programming/javascript/6135-javascript-data-structures-typed-arrays.html

0 commit comments

Comments
 (0)