Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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";