This survey closed on January 31, 2022. Ver los resultados de la encuesta
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));