forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray_slice.js
More file actions
31 lines (23 loc) · 921 Bytes
/
array_slice.js
File metadata and controls
31 lines (23 loc) · 921 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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var x = [1, 2, 3, 4, 5, 6, 7, 8]
WScript.Echo(x.slice(9,11));
WScript.Echo(x.slice(1, "abc", 5, 9));
WScript.Echo(x.slice());
WScript.Echo(x.slice(3));
WScript.Echo(x.slice(9));
WScript.Echo(x.slice(-19));
WScript.Echo(x.slice(-7, 4));
WScript.Echo(x.slice(2, -4));
WScript.Echo(x.slice(5, 2));
WScript.Echo(x.slice(-12, -9));
WScript.Echo(x.slice(-12, -15));
var large = new Array(1000000);
for (var i = 0; i < large.length; i++)
{
large[i] = 0;
}
s = large.slice(0, large.length - 1);
WScript.Echo(s.length);