How to return a string from a JavaScript function?



To return a string from a JavaScript function, use the return statement in JavaScript.

Example

You need to run the following code to learn how to return a string using return statement −


   
      
   
   
   
      

Click the following button to call the function

     
               
   
Updated on: 2020-06-19T11:43:44+05:30

17K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements