concatmulti_compoundstring.js 715 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. function test()
  6. {
  7. var cs = "a";
  8. for (var i = 0; i < 10; i++)
  9. {
  10. cs += i; // create compound string
  11. }
  12. var a = "blahblahblah" + cs + "blahblahblah"; // concat node
  13. cs += "Z"; // modify compound string
  14. WScript.Echo(a); // make sure the concat string is still valid
  15. }
  16. test();
  17. test();