运行 ❯
获取你
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Assignments</h1> <h2>The ??= Operator</h2> <p>The ??= operator is used between two values. If the first value is undefined or null, the second value is assigned.</p> <p id="demo"></p> <script> let x; document.getElementById("demo").innerHTML = x ??= 5; </script> </body> </html>