Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

JavaScript Expressions Complete Reference

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

JavaScript’s expression is a valid set of literals, variables, operators, and expressions that evaluate a single value that is an expression. This single value can be a number, a string, or a logical value depending on the expression.

Example:

Javascript




<script>
    // Illustration of function* expression
    // use of function* keyword
    function* func() {
      yield 1;
      yield 2;
      yield 3;
      yield " - Geeks";
    }
       
    let obj = '';
       
    // Function calling
    for (const i of func()) {
          obj = obj + i;
    }
   
    // Output
    console.log(obj);
</script>

Output:

123 - Geeks

The Complete List of JavaScript Expressions are listed below:

JavaScript Primary Expressions

 Expressions

Description

Example

this keywordThat defines the current line of code’s execution context.
Async/Await FunctionChecks that we are not breaking the execution thread.
Object initializer They have properties and methods attached to them and properties are in the form of key-value pairs. 
Grouping operatorThe Grouping operator consists of a pair of parentheses around an expression.
async function The async function is declared using the async keyword. 
Regular ExpressionsThe search pattern can be used for text search and text to replace operations.
function* ExpressionDefine a generator function inside an expression.
Function ExpressionDefine a function inside an expression.
class ExpressionThe class name is used internally, but not outside of the class.

My Personal Notes arrow_drop_up
Last Updated : 31 May, 2023
Like Article
Save Article
Similar Reads
Related Tutorials