DEV Community

loading...

isObj (Test if a value is an Object instance

functional_js profile image Functional Javascript ・1 min read

Alt Text

Explanation

1.
The two arrays (aTrue and aFalse) contain...

  • 8 examples of "true" values
  • 24 examples of "false" values

2.
The bottom line of the logged output (right pane) which printed, "isObj 1e+9: 1.686s"
reads as, "the isObj func was run in a loop 1 billion times and took 1.6 second".

Note that (8 + 24) * 1B = 32 billion times the isObj func was called in 1.6 seconds

Source Code at:

https://gist.github.com/funfunction/b4b41804615a0ffce0c31b016de3f848

Discussion (0)

pic
Editor guide