(廣告,請勿封鎖。)

測驗 » 布林值

1. typeof

下列哪個斷言成立?

2. 偽值

下列哪些值是偽值?

3. 檢查是否提供參數

function func(arg) {
  if (!arg) {
    throw new Error('Missing argument');
  }
  return 'ok';
}

下列哪些函式呼叫會擲出錯誤?

4. 檢查屬性是否存在

function func(obj) {
  if (!obj.prop) {
    throw new Error('Missing property `prop`');
  }
  return 'ok';
}

下列哪些函式呼叫會擲出錯誤?

5. 邏輯與 (1/3)

6. 邏輯與 (2/3)

7. 邏輯與 (3/3)

8. 邏輯或 (1/3)

9. 邏輯或 (2/3)

10. 邏輯非

下列哪個表達式為 true(其他為 false)?


正確答案:0 個中的 0 個