Sort Score
Result 10 results
Languages All
Labels All
Results 91 - 100 of 23,402 for

js

(0.07 sec)
  1. Nullish coalescing operator (??) - JavaScript |...

    The nullish coalescing (??) operator is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.... Try it Syntax js leftExpr ?? rightExpr Description...will be thrown in such cases. js null || undefined ?? "foo"; //...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  2. Array.prototype.includes() - JavaScript | MDN

    The includes() method of Array instances determines whether an array includes a certain value among its entries, returning true or false as appropriate.... Try it Syntax js includes(searchElement) includes(searchElement...properties. Examples Using includes() js [1, 2, 3].includes(2); // true...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  3. Function - MDN Web Docs Glossary: Definitions o...

    A function is a code snippet that can be called by other code or by itself, or a variable that refers to the function. When a function is called, arguments are passed to the function as input, and the function can optionally return a value. A function in JavaScript is also an object....declarations must have a name: js // Anonymous function created...function with a function name: js // Function declaration function...

    developer.mozilla.org/en-US/docs/Glossary/Function
  4. SyntaxError: Unexpected token - JavaScript | MDN

    The JavaScript exceptions "unexpected token" occur when the parser does not see a token it recognizes at the given position, so it cannot make sense of the structure of the program. This might be a simple typo.... js for (let i = 0; i < 5,; ++i)...or adding another expression: js for (let i = 0; i < 5; ++i) {...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  5. Working with objects - JavaScript | MDN

    JavaScript is designed on an object-based paradigm. An object is a collection of properties, and a property is an association between a name (or key) and a value. A property's value can be a function, in which case the property is known as a method....using an object initializer is: js const obj = { property1: value1...the expression cond is true: js let x; if (cond) { x = { greeting:...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  6. SyntaxError: Unexpected '#' used outside of cla...

    The JavaScript exception "Unexpected '#' used outside of class body" occurs when a hash ("#") is encountered in an unexpected context, most notably outside of a class declaration. Hashes are valid at the beginning of a file as a hashbang comment, or inside of a class as part of a private field. You may encounter this error if you forget the quotation marks when trying to access a DOM identifier as well.... For example js document.querySelector(#some-element)...ement) This can be fixed via js document.querySelector("#some-element");...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  7. Unary negation (-) - JavaScript | MDN

    The unary negation (-) operator precedes its operand and negates it.... Try it Syntax js -x Description The - operator...negation. Examples Negating numbers js const x = 3; const y = -x; //...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  8. Labeled statement - JavaScript | MDN

    A labeled statement is any statement that is prefixed with an identifier. You can jump to this label using a break or continue statement nested within the labeled statement.... Try it Syntax js label: statement label Any JavaScript...labeled continue with for loops js // The first for statement is...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  9. Logical AND assignment (&&=) - JavaScript | MDN

    The logical AND assignment (&&=) operator only evaluates the right operand and assigns to the left if the left operand is truthy.... Try it Syntax js x &&= y Description Logical AND...error, despite x being const : js const x = 0; x &&= 2; Neither...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  10. function - JavaScript | MDN

    The function declaration creates a binding of a new function to a given name.... Try it Syntax js function name(param0) { statements...inconsistent across implementations. js console.log( `'foo' name ${ "foo"...

    developer.mozilla.org/en-US/docs/Web/JavaScript...