JavaScript function* expression Last Updated : 07 Aug, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The function* is an inbuilt keyword in JavaScript which is used to define a generator function inside an expression. Syntax: function* [name]([param1[, param2[, ..., paramN]]]) { statements}Parameters: This function accepts the following parameter as mentioned above and described below: name: This parameter is the function name.paramN: This parameter is the name of an argument to be passed to the function.statements: These parameters comprise the body of the function.Example 1: Below examples illustrate the function* expression in JavaScript: JavaScript // 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); Output123 - GeeksExample 2: Below examples illustrate the function* expression in JavaScript: JavaScript // Illustration of function* expression // use of function* keyword function* func2(y) { yield y * y; }; function* func1() { for (let i = 1; i < 6; i++) { yield* func2(i); } }; // Function calling for (const x of func1()) { // Output console.log(x); }; Output1 4 9 16 25Supported Browsers: The browsers supported by JavaScript function* expression are listed below: Google Chrome 49 and aboveEdge 12 and aboveFirefox 26 and aboveOpera 36 and aboveSafari 10 and above Comment More infoAdvertise with us Next Article JavaScript Function Definitions S SHUBHAMSINGH10 Follow Improve Article Tags : JavaScript Web Technologies javascript-basics Similar Reads JavaScript Function Expression A function expression is a way to define a function as part of an expression making it versatile for assigning to variables, passing as arguments, or invoking immediately.Function expressions can be named or anonymous.They are not hoisted, meaning they are accessible only after their definition.Freq 3 min read JavaScript Function Definitions JavaScript functions are declared using the function keyword, either as a declaration or expression. Declarations define named functions, while expressions assign functions to variables. Both enable code reuse and modularity.SyntaxFunction Declarationsfunction functionName( parameters ) { // Stateme 2 min read Lambda Expressions in JavaScript A lambda expression also known as arrow-function is a function without a name defined using the arrow => syntax introduced in ES6 (ECMAScript 2015). Unlike traditional function declarations or expressions, lambda expressions are shorter and come with some unique behavior, particularly around the 5 min read JavaScript Anonymous Functions An anonymous function is simply a function that does not have a name. Unlike named functions, which are declared with a name for easy reference, anonymous functions are usually created for specific tasks and are often assigned to variables or used as arguments for other functions.In JavaScript, you 3 min read JavaScript Function() Constructor The JavaScript Function() constructor is used to create new function objects dynamically. By using the Function() constructor with the new operator, developers can define functions on the fly, passing the function body as a string. This allows for greater flexibility in situations where functions ne 2 min read eval() vs. Function() in JavaScript We will learn about JavaScript functions eval() and Function(). The eval() and Function() are used to evaluate any JavaScript expression passed to either of them as a string but the difference between them is how how they handle the expression. eval() The eval() method in JavaScript evaluates or exe 2 min read Like