Question: Language: JAVA Script Write a function 'morseCode' that takes an array containing a series of either 'dot' or 'dash' strings. Your function should console.log each

Language: JAVA Script

Write a function 'morseCode' that takes an array containing a series of either 'dot' or 'dash' strings. Your function should console.log each string in order, followed by a pause of 100ms after each "dot and 300ms after each 'dash`.

Example:

let code= ['dot', 'dash', 'dot'];

morseCode (code);

// print 'dot'

// pause for 100ms

// print 'dash'

// pause for 300ms

// print 'dot'

// pause for 100ms

***************

function morseCode (code) {

|// Your code here

}

***DO NOT MODIFY ANYTHING UNDER THIS LINE***

try {

| module.exports = morseCode;

} catch {

| module.exports = null;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!