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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started