About 313,000 results
Open links in new tab
  1. Returning a string in Javascript - Stack Overflow

    Dec 29, 2012 · I am trying to create a simple function that will return the correct string when called: function getState(abbr){ if (abbr=="WY") { return "Wyoming"; } } and then the call is like …

  2. JavaScript return Statement - W3Schools

    The return statement stops the execution of a function and returns a value. Read our JavaScript Tutorial to learn all you need to know about functions. Start with the introduction chapter about …

  3. JavaScript Return Statement - GeeksforGeeks

    Feb 7, 2025 · You can return values from a function using the return statement, and these values can be of any type (number, string, object, etc.). JavaScript function greet ( name ) { return …

  4. return - JavaScript | MDN - MDN Web Docs

    Mar 13, 2025 · In a generator function, the produced generator object's next() method returns { done: true, value: returnedValue }. In an async generator function, the produced async …

  5. Return a String from a JavaScript Function - Online Tutorials …

    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 −

  6. JavaScript Strings - W3Schools

    To solve this problem, you can use an backslash escape character. The backslash escape character (\) turns special characters into string characters: let text = "We are the so-called …

  7. JavaScript function return string - EyeHunts

    May 10, 2023 · In JavaScript, functions can return string values. A function can take parameters and manipulate them to return a string using string concatenation or string interpolation. This …

  8. How do I return a string with an object in javascript?

    Dec 16, 2019 · function getName( { name /*, email, id*/} ) { return `Hello my name is ${name}`; //You can also return a console log } let instance1 = getName( passing); console.log(instance1);

  9. How To Use Return in JavaScript? - GeeksforGeeks

    Feb 17, 2025 · The return statement in JavaScript is used to end a function execution and send a value back to where the function was called. It allows the function to provide useful results, like …

  10. String - JavaScript | MDN - MDN Web Docs

    Apr 10, 2025 · Returns a string created by using the specified sequence of Unicode values. String.fromCodePoint() Returns a string created by using the specified sequence of code …

  11. Some results have been removed
Refresh