Create the function front33 that accepts a string as an argument. The first thre
ID: 3760041 • Letter: C
Question
Create the function front33 that accepts a string as an argument. The first three letters of the string are added to the front of the string and at the end of the string. If the string length is less than 3, use whatever chars are present.
The function takes a string character and returns a new string taking the first three characters of the input string and adding them to the front and the back of the string.
(must be done in javascript)
EXAMPLES
INPUT: front33("HelloWorld");
OUTPUT: "HelHelloWorldHel";
INPUT: front33("Go");
OUTPUT: "GoGoGo";
Explanation / Answer
INPUT: front33("HelloWorld");
OUTPUT: "HelHelloWorldHel";
INPUT: front33("Go");
OUTPUT: "GoGoGo";
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.