Thank-you Christopher

Of late I've been using Cybero's Javascript for QC guide. I need to cast the net a bit wider again I guess. That answered my question though, cheers.

Alastair

On 08/07/2010, at 1:53 AM, Christopher Wright wrote:

What is the best test? Best meaning accurate and timely.

instanceof and typeof.

var aThing = 42;

function (__boolean isBool, __string type) main (__number patchTime)
{
        var result = new Object();
        result.isBool = (typeof aThing == "boolean");
        result.type = typeof aThing;
        return result;
}

type = "number" in this case (so isBool is false). If you change it to "aThing = false", or "aThing = "hi mom"", you'll get "boolean" and "string" respectively. (you can also check for arrays and objects this way, I think).

There are thousands of websites devoted to teaching JS so you can make gaudy animated cursors on webpages and whatnot -- you can glean a ton from such sources.

--
Christopher Wright
christopher_wri...@apple.com




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to