WhileLoop.js 714 B

12345678910111213141516171819202122232425
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. var x = 6;
  6. var giraffe = 8;
  7. var zebra = x + giraffe;
  8. function f(t) {
  9. return t + t;
  10. }
  11. var cat = f(zebra);
  12. rat = cat * 2;
  13. while (rat > 4) {
  14. rat = rat - 3;
  15. cat = cat + 4;
  16. }
  17. var dragon = rat / 2;
  18. WScript.Echo(x)
  19. WScript.Echo(giraffe)
  20. WScript.Echo(zebra)
  21. WScript.Echo(cat)
  22. WScript.Echo(rat)
  23. WScript.Echo(dragon);