Example 1
Input
"Ana"
Expected result
"¡Hola, Ana! Bienvenido a Código con Criterio."
Nexo is preparing the challenges…
Nexo · Connect the ideas
Receive a name as text and return a personalized greeting matching the exact required format using return and basic string concatenation.
cadenas · entrada-salida · concatenacion
In programming, a function takes an input value, processes it, and delivers an output result using return.
You receive a person's name in input as a text string (string). Your goal is to build and return the exact following personalized greeting:
"¡Hola, [nombre]! Bienvenido a Código con Criterio."
Replace [nombre] with the value received in input, preserving every punctuation mark (¡, ,, !, .), uppercase letter, accent mark, and space exactly as shown in the format.
input will always be a non-empty string of 1 to 30 characters, with no leading or trailing spaces.return: Return the final string using return. Do not use console.log as your result, since logging to the console does not return a value to the caller.+ operator or template literals with backticks). You do not need conditionals, loops, arrays, objects, or advanced string methods.Complete function solve(input) and return the resulting string. The input always satisfies the described constraints. Do not use network calls, files, imports, packages, or asynchronous code.
Input
"Ana"
Expected result
"¡Hola, Ana! Bienvenido a Código con Criterio."
Input
"Mateo"
Expected result
"¡Hola, Mateo! Bienvenido a Código con Criterio."
Input
"Sofía"
Expected result
"¡Hola, Sofía! Bienvenido a Código con Criterio."
Implement solve(input) and return the result. Synchronous JavaScript, without packages, network or account access.
76/10.000 characters · In the advanced editor, press Escape and then Tab to leave.
Your code is restored in this browser. Saving to your account is optional.
Try solving it first. Viewing the solution records assisted use.