DoLoop2.js 547 B

123456789101112131415161718192021
  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 a = 0;
  6. function isless(x,y)
  7. {
  8. return (x < y);
  9. }
  10. var i = 0;
  11. do
  12. {
  13. a += i;
  14. ++i;
  15. } while(isless(i, 100) && isless(a, 5000));
  16. WScript.Echo(a);