返回卡包市场

JavaScript

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 24内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (24 张)

#1
正面 (问题)

What is JavaScript?

背面 (解答)

JavaScript is a single-threaded, multi-paradigmed (OOP and FP), interpreted, programming language

#2
正面 (问题)

What is the difference between let, const, and var?

背面 (解答)

let and const are blocked scoped. var is function scoped no matter how deeply it may be nested inside that function.

#3
正面 (问题)

What is the difference between a first-class and higher-order function?

背面 (解答)

A first-class function is a function that can be used just like any other variable. For example, a first-class function can be assigned to a variable, passed as an argument to another function, and even even be returned by a function. A higher-order function is a subset of a first-class function; it can only be passed to and returned by other functions

#4
正面 (问题)

What is JS’s most popular execution environment?

背面 (解答)

The browser

#5
正面 (问题)

What are the 7 primitive types and what are their associated bits?

背面 (解答)

• number (64 bit double) • bigInt (arbitrary bit integer) • boolean • string (16 bit unicode) • null • undefined

#6
正面 (问题)

What is the result of the following code: NaN === NaN

背面 (解答)

The result is false. This is because NaN is not equal to any other value, including itself. Use Number.isNaN(x) instead

#7
正面 (问题)

What is the behavior of === for primitives and reference types?

背面 (解答)

Primitives: • Test to see if 2 values are the same Reference Types: • Test to see if 2 reference variables point to the same object in the heap

#8
正面 (问题)

Are strings iterable?

背面 (解答)

Yes

#9
正面 (问题)

What are the 2 ways to access a character of a string at a given index?

背面 (解答)

1. str.charAt(index); 2. str[index];

#10
正面 (问题)

Code an example of a template literal

背面 (解答)

let name = "Gianmarco"; Console.log(`Hello, ${name}!`)

#11
正面 (问题)

Which 5 values evaluate to false and which values evaluate to true?

背面 (解答)

Evaulate to false: * null * undefined * NaN * 0 * “” Evaluates to true: * Everything else

#12
正面 (问题)

What is the global object for all JS code inside a browser?

背面 (解答)

Window

#13
正面 (问题)

What is the default value for uninitialized variables?

背面 (解答)

undefined

#14
正面 (问题)

Code an example of a destructuring assignment

背面 (解答)

let [x, y] = [1, 2]; // variable names do not have to match console.log(x, y); // 1 2 let {x, y} = {x: 0, y:0} // variable names must match, else undefined console.log(x, y) // 0 0

#15
正面 (问题)

Code an example of the 2 different ways to access an object’s property

背面 (解答)

let obj = {x:0, y:0}; console.log(obj["x"]); // 0 console.log(obj.x); // 0

#16
正面 (问题)

What is the behavior of optional chaining? a?.b;

背面 (解答)

If a is not null or undefined, access b. Else, return undefined

#17
正面 (问题)

All objects are instances of which class?

背面 (解答)

Object

#18
正面 (问题)

What do the following expressions return? 1 && 2; 0 && 1; 1 && 0;

背面 (解答)

1 && 1 returns 2. This is because if both values are true, the right operand is returned 0 && 1 returns 0. This is because if the first value is false, the expressions short circuits and returns it 1 && 0 returns 0. This is because 1 is true so the operator returns the right operand

#19
正面 (问题)

Code a function using a default parameter value

背面 (解答)

function f(x = 0) {...}

#20
正面 (问题)

What is the behavior of the nullish coalescing operator? a ?? b;

背面 (解答)

If a is null or undefined, return b. Else, return a

#21
正面 (问题)

What does the following code return? let result = "x" in {x: 0}; console.log(result);

背面 (解答)

function

#22
正面 (问题)

What is the behavior of the following code? let obj = {x:0, y:0}; delete obj.x; console.log(obj);

背面 (解答)

Deletes the x property of obj {y:0}

#23
正面 (问题)

What is the behavior of the following code? let arr = [1,2,3]; delete arr[0]; console.log(arr.length); console.log(typeof arr[0]);

背面 (解答)

Deletes the first element of arr causing it to become a sparsed array. It’s length will remain at 3 but its first element will be undefined

#24
正面 (问题)

Code 2 examples using the in operator. 1 for an array, and the other for an object

背面 (解答)

let arr = ["a","b"]; console.log(0 in arr); // true let obj = {x:0, y:0}; console.log("x" in obj); //true