0
What is the use of return key in javascript
3 odpowiedzi
+ 2
Please use only relevant words in tags, and avoid writing your question into the tags ☝
+ 2
Monu Kumar
Used to return something from a Function
For eg:-
Function hi(name){
return "hello "+name
}
//This function takes name as a parameter and returns "hello"+ name
//using hi();
alert(hi("Arnav"));
//Now hi("Arnav") will be replaced with "hello Arnav" and alerts("hello Arnav")
That's what a return statement do