Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Test the map function in Example F from Lab1Template.html . Try modifying it to make sure that you understand it. a) Using map , write
Test the map function in Example F from Lab1Template.html . Try modifying it to make sure that you understand it.
a) Using map , write code that when given an array of strings, returns the length of each string. ie: [Canada, Mauritania, US, Iceland ]. map(function() { ..... }) returns [6, 10, 2, 7]
//Example F: map: apply a function to each item in a list list=[1,2,3,4,5,6]; result=list.map(function (x) { return x*x;}); console.info("Example F: map"); console.log(result);
using javascript
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