I am still learning JavaScript, reading books using FireBug, experimenting.
I am amazed and stuck on the things below.
Have a feature declaration:
var t = function (args){ ... }
He suggested that he varargs.
I call it this way:
<body onload="t({to:100,from:0})">
It is possible to get the value of the from argument by calling:
args.from
The result of typeof args.from is number
It looks great.
note: number is lowercase
I'm interested in the args.from example.
In fact, it is impossible to get the value of your instance.
tried:
args.from instanceof Number args.from instanceof String args.from instanceof Object args.from instanceof Boolean
This is not number - very strange This is not Object - rather strange This is not String that is OK
It's not a boolean - that's OK
This is neither null nor 'undefined' - it looks fine.
What is it?
source share