forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconcat1.js
More file actions
33 lines (26 loc) · 831 Bytes
/
concat1.js
File metadata and controls
33 lines (26 loc) · 831 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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
WScript.Echo("Basic string concatenation.");
var n = 5;
var x = new Array(n);
var count = 1;
for(var i = 0; i < n; ++i)
{
var c = String.fromCharCode(97+i);
x[i] = "";
for(var j = 0; j < count; ++j)
{
x[i] += c;
}
count *= 3;
}
var str = x[0];
str += x[1] + x[2];
str += "XXXX";
str += x[3] + "XXXX";
str += str + x[4] + str + x[4];
str += str + x[0] + str;
str += "XXXX";
WScript.Echo(str);