//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- function write(v) { WScript.Echo(v + ""); } function check(str) { var res = eval(str); write((typeof res) + " : " + res); } var count = 0; function fn() { return count++;} function fs() { count++; return (count % 2 ) ? "str1" : "str2"; } function fb() { count++; return (count % 2 ) ? true : false; } var list = [ "fn", "fs", "fb" ]; var vars = [ "o", "n", "d", "a", "b"]; var o = {}; var n = new Number(123456); var d = new Date("Thu Jan 10 05:30:01 UTC+0530 1970"); var a = []; var b = new Boolean(true); a[0] = o; a[1] = n; a[2] = d; a[3] = a; a[4] = b; check("a.toString()"); check("a.toLocaleString()"); for (var i=0; i