-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathDoLoop.js
50 lines (44 loc) · 1 KB
/
DoLoop.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
//-------------------------------------------------------------------------------------------------------
// 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 = 6;
var giraffe = 8;
var zebra = x + giraffe;
function f(t) {
return t + t;
}
var cat = f(zebra);
rat = cat * 2;
do {
rat = rat - 3;
cat = cat + 4;
}
while (rat > 4);
var dragon = rat / 2;
WScript.Echo(x)
WScript.Echo(giraffe)
WScript.Echo(zebra)
WScript.Echo(cat)
WScript.Echo(rat)
WScript.Echo(dragon);
do
{
WScript.Echo("Should print once - 0");
}
while(0);
do
{
WScript.Echo("Should print once - false");
}
while(false);
a: do
{
WScript.Echo("Should print once - label");
do
{
break a;
}while(false);
WScript.Echo("Should not print");
}
while(false);