Subj : can't understand difference in vars To : netscape.public.mozilla.jseng From : "Jashin Eugene" Date : Tue Mar 23 2004 05:42 pm Ok.. There is 2 variants of code: 1: var n = 3; logging(n); logging(typeof(n)); switch(n) { case 3: logging("AAA"); break; default: logging("DDD"); } where logging, it just function for output string into log. Output of this code is "3", "number", "AAA". 2: var n = MakeThree(); switch(n) { case 3: logging("AAA"); break; default: logging("DDD"); } where MakeThree defined as: JSBool MakeThree(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { *rval = DOUBLE_TO_JSVAL( JS_NewDouble(cx, (double)3) ); return JS_TRUE; } Output of this code is "3", "number", "DDD". I don't understand, what's wrong?! .