[Vuejs]-'|' or operator meaning in vuejs src code "vnode.js"?

-1👍

Here | is an OR unary operator.

ns: string | void;

which means ns is of type string, but if string is not defined due to some reason, it will be of type void. This should be just for precaution if it is not defined in some browser version.

Leave a comment