This survey closed on December 1, 2022. View Survey Results »
Welcome to the survey! This first part is all about figuring out which features of the JavaScript language you've used before.

Returns a single Promise that fulfills when all of the input's promises fulfills.

js
const promises = [promise1, promise2];

Promise.allSettled(promises).then((results) =>
  results.forEach((result) => console.log(result.status)),
);

Load a module asynchronously and dynamically.

js
await import('/modules/my-module.js')

Return first value, or second value if first value is null or undefined.

js
const foo = null ?? 'default string';
console.log(foo);
// expected output: "default string"

const baz = 0 ?? 42;
console.log(baz);
// expected output: 0

Properties that cannot be legally referenced outside of the class.

js
class ClassWithPrivateField {
  #privateField
}

Replace all instances of a string.

js
const s1 = "foo_bar_baz";
const s2 = s1.replaceAll('_', '-');

Return an iterator of all results matching this string against a regular expression.

js
const regexp = /t(e)(st(\d?))/g;
const str = 'test1test2';
const array = [...str.matchAll(regexp)];

Operators to assign a value to a variable based on its own truthy/falsy status.

js
const a = { duration: 50, title: '' };

a.duration ||= 10;
console.log(a.duration);
// expected output: 50

a.title ||= 'title is empty.';
console.log(a.title);
// expected output: "title is empty"

Returns a single Promise that fulfills when any of the input's promises fulfills.

js
const promises = [promise1, promise2, promise3];

Promise.any(promises).then((value) => console.log(value));

Provides standard objects and functions for working with dates and times.

Returns the value of the last element that satisfies the testing function.

js
const array1 = [5, 12, 50, 130, 44];
const found = array1.findLast((element) => element > 45);
console.log(found);
// expected output: 130

Indicate the specific original cause of the error.

js
try {
  connectToDatabase();
} catch (err) {
  throw new Error('Connecting to database failed.', { cause: err });
}

js
const object1 = {
  prop: 'exists'
};
console.log(Object.hasOwn(object1, 'prop'));
// expected output: true

Store the start and end positions of each matched capture group.

js
const str1 = "foo bar foo";
const regex1 = /foo/dg;
console.log(regex1.exec(str1).indices[0]); // Output: Array [0, 2]