Question: Write a javascript function called, displayEachRegNumber, that takes a list of registration numbers and displays each registration number in the list on a new line.

Write a javascript function called, displayEachRegNumber, that takes a list of registration numbers and displays each registration number in the list on a new line.

These asserts will test your function

The code below be executed against the function you wrote when you press the Execute code button.

displayEachRegNumber(['CY 123 456', 'CL 876 895', 'CK 456 765', 'CA 345 673'])

//['CY 123 456', 'CL 876 895', 'CK 456 765', 'CA 345 673'] assert.equal('CY 123 456', logList[0]); assert.equal('CL 876 895', logList[1]); assert.equal('CK 456 765', logList[2]); assert.equal('CA 345 673', logList[3]);

logList = []; displayEachRegNumber(['CJ 123', 'CL 876']); assert.equal('CJ 123', logList[0]); assert.equal('CL 876', logList[1]);

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!