Null coalescing operator angular 2

What is the equivalent of null coalescing operator (??) in angular 2.

In C# we can perform an operation:

string str = name ?? FirstName :"First Name is null";

Coalescing is performed via || operator, ie

let str:string = name || FirstName || "name is null and FirstName is null";

You can also read this question for more details and explanations.

链接地址: http://www.djcxy.com/p/73374.html

上一篇: 字符串中的javascript null值

下一篇: 空合并运算符角2