• in
InterCourses
CoursesBlogs
0
← Introduction to JavaScript
○What is JavaScript?○Your First JavaScript Code○Data Types○Type Checking
○Declaring Variables○let and const in Practice○Operators○Type Conversion
○Conditionals○Switch Statement○For Loops○While Loop○Break and Continue
○Defining Functions○Arrow Functions○Scope○Closures○Project - Calculator●Function Expressions
○Arrays○Array Mutation Methods○Array Search and Slice○Array Iteration Methods○Multidimensional Arrays○Destructuring○Array Reverse and Sort○Array Fill○Array Find and Includes○Array Flat and FlatMap○Array Reduce, Some, and Every
○Objects○Object Methods and Destructuring○JSON○Math and Date○Date Basics
○02 Template Literals○String Methods○Regular Expressions
○Higher-Order Functions○Callbacks○map, filter, and reduce○Recursion○Project - Data Transform Pipeline
○OOP Introduction○Classes○Inheritance○Encapsulation
○Asynchronous JavaScript○Promises and Async Await○Async API Simulation

Function Expressions

Not every function is declared with the function name() form. Function expressions are common in callbacks and assigned helpers, so beginners should practice that syntax too.

Example

javascript
const greetStudent = function (name) {
  return `Welcome, ${name}!`;
};

Your Task

  1. Create a function expression greetStudent that returns Welcome, <name>!.
  2. Display Welcome, Maya! in #output by calling the function.
Hint 1
1 / 2
HINT 1

Store the function in a const variable.

Loading editor…
READY
intercourses
javascript