← Back to challenges

Concatenate First and Last Name into One String

JavaScriptMediumstringsformattinglanguage_fundamentals

Instructions

Given two strings, firstName and lastName, return a single string in the format "last, first".

Examples

concatName("First", "Last") ➞ "Last, First"

concatName("John", "Doe") ➞ "Doe, John"

concatName("Mary", "Jane") ➞ "Jane, Mary"
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.