I'm using the library GoJS in my Angular project.
When I want to return a new Size()
from gojs with only one parameter, the other one has to be NaN:
I'm doing something like new Size(NaN, height)
The constructor of Size() looks like this: constructor(w?: number, h?: number);
Why can't I use null
instead of NaN
?
When using null
the browser returns Error: Invalid arguments to Size constructor: null, 200
I don't have a problem to fix, I just don't understand why it wouldn't work with null