← Back to challenges

Basic Variable Assignment

JavaScriptMediumbugsfunctional_programminglanguage_fundamentalsstrings

Instructions

A student learning JavaScript was trying to make a function. His code should concatenate a passed string name with string "Edabit" and store it in a variable called result. He needs your help to fix this code.

Examples

nameString("Mubashir") ➞ "MubashirEdabit"

nameString("Matt") ➞ "MattEdabit"

nameString("javaScript") ➞ "javaScriptEdabit"

Notes

  • Don't forget to return the result.
  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Less Than 100?