scrimba
JavaScriptmas 2022
JavaScriptmas: 🤖 Insert Dashes
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

JavaScriptmas: 🤖 Insert Dashes
AboutCommentsNotes
JavaScriptmas: 🤖 Insert Dashes
Expand for more info
main.js
run
preview
console
// 1) split() the string into an array of two words
// 2) map() over each word in the array, split() each word and then join()
// the letters of each word with a hyphen
// 3) refactor
// 4) place the code inside the function
// 5) uncomment the test suite and run your code


function insertDashes(arr) {
// write code here
}



/**
* Test Suite
*/
// describe('insertDashes()', () => {
// it('insert dashes in between chars', () => {
// // arrange
// const value = "aba caba";

// // act
// const result = insertDashes(value);

// // log
// console.log("result: ", result);

// // assert
// expect(result).toBe("a-b-a c-a-b-a");
// });
// });
Console
/index.html
-5:17