x in y
returns true
if x
is a valid property of y
or its prototype chain.
> "foo" in {foo: 3}
true
> 2 in ["a", "b", "c"]
true
typeof x
or typeof(x)
returns the type as a string.
x instanceof y
returns true if x
is an object of type y
.
> class A {}
> (new A) instanceof A
true
void x
or void(x)
evaluates expression x
and returns undefined
.
Refers to the current object.
Refers to the parent of the current object. Usually to call the parent constructor:
> super(props)
but also can be used to call functions on the parent:
> super.foo()