Sort Score
Result 10 results
Languages All
Labels All
Results 111 - 120 of 23,332 for

js

(0.12 sec)
  1. Public class fields - JavaScript | MDN

    Public fields are writable, enumerable, and configurable properties. As such, unlike their private counterparts, they participate in prototype inheritance.... Syntax js class ClassWithField { instanceField;...field names may be computed. js const PREFIX = "prefix"; class...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  2. Default parameters - JavaScript | MDN

    Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.... Try it Syntax js function fnName(param1 = defaultValue1...and multiply would return NaN . js function multiply(a, b) { return...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  3. History API - Web APIs | MDN

    The History API provides access to the browser's session history (not to be confused with WebExtensions history) through the history global object. It exposes useful methods and properties that let you navigate back and forth through the user's history, and manipulate the contents of the history stack....move backward through history: js history.back(); This acts exactly...the Forward button), like this: js history.forward(); Moving to...

    developer.mozilla.org/en-US/docs/Web/API/Histor...
  4. Background scripts - Mozilla | MDN

    Background scripts or a background page enable you to monitor and react to events in the browser, such as navigating to a new page, removing a bookmark, or closing a tab....js"], "persistent": false, "type":...type="module" src="background-script.js"></script> </head> </html> You...

    developer.mozilla.org/en-US/docs/Mozilla/Add-on...
  5. The arguments object - JavaScript | MDN

    arguments is an array-like object accessible inside functions that contains the values of the arguments passed to that function....you can access them as follows: js arguments[0]; // first argument...and returns the longest one: js function longestString() { let...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  6. for - JavaScript | MDN

    The for statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement (usually a block statement) to be executed in the loop.... Try it Syntax js for (initialization; condition;...after each pass through the loop. js for (let i = 0; i < 9; i++) {...

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

    The function keyword can be used to define a function inside an expression.... Try it Syntax js function (param0) { statements...expressions before you create them: js console.log(notHoisted); // undefined...

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

    The break statement terminates the current loop or switch statement and transfers program control to the statement following the terminated statement. It can also be used to jump past a labeled statement when used within that labeled statement.... Try it Syntax js break; break label; label Optional...then returns the value 3 * x . js function testBreak(x) { let i...

    developer.mozilla.org/en-US/docs/Web/JavaScript...
  9. Loops and iteration - JavaScript | MDN

    Loops offer a quick and easy way to do something repeatedly. This chapter of the JavaScript Guide introduces the different iteration statements available to JavaScript....expressed this way as a loop: js for (let step = 0; step < 5;...for statement looks as follows: js for (initialization; condition;...

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

    The try...catch statement is comprised of a try block and either a catch block, a finally block, or both. The code in the try block is executed first, and if it throws an exception, the code in the catch block will be executed. The code in the finally block will always be executed before control flow exits the entire construct.... Try it Syntax js try { tryStatements } catch (exceptionVar)...instead of single statements. js try doSomething(); // SyntaxError...

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