Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/376.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在javascript/typescript中,双问号是什么意思?_Javascript_Typescript_Symbols - Fatal编程技术网

在javascript/typescript中,双问号是什么意思?

在javascript/typescript中,双问号是什么意思?,javascript,typescript,symbols,Javascript,Typescript,Symbols,我看到了这段代码,但不理解这个符号在Javascript或typescript中的含义: const _apolloClient = apolloClient ?? createApolloClient(context); 对像我这样懒惰的人的简短回答: 如果firstValue为null或未定义 console.log(firstValue??secondValue)//secondValue 如果firstValue不是null或未定义 console.log(firstValue??s

我看到了这段代码,但不理解这个符号在Javascript或typescript中的含义:

const _apolloClient = apolloClient ?? createApolloClient(context);
对像我这样懒惰的人的简短回答: 如果
firstValue
null未定义

console.log(firstValue??secondValue)//secondValue
如果
firstValue
不是null未定义

console.log(firstValue??secondValue)//firstValue