problem:- You need to get the values from your select
elements. These values will currently be strings and you will convert them into numbers.
Use the map
function to iterate over the array. Pass a callback function to map
that takes a dropdown
parameter and returns dropdown.value
.
const sortInputArray = (event) => {
event.preventDefault();
const inputValues = [...document.getElementsByClassName("values-dropdown")]
.map(dropdown =>Number(dropdown.value));
}
Error:- Your map
callback function should implicitly return dropdown.value .
This error is occurring. How it can be solved?
Hi @asifKhan , you weren’t asked to use Number()
constructor for the challenge step.
Aur maine bina Number constructor ka use karke bhi code submit kiya but code submit nahi hau.
These aren’t the instructions for the challenge step.
That is the instructions to be implemented.
iske bawajood bhi error aa rahi hai.
Error:- Your map
callback function should implicitly return dropdown.value
map() method ko variable inputValues
k Sath use kro.
Link post kren challenge step ka.
Your map
callback function should take a dropdown
parameter.
map
callback function should implicitly return dropdown.value
.
ab ye error aa rahi hai.
.map()
se pehly array k bad space nhi hona chaiye aur Number() constructor nhi hona chahiye uper Wala code me.
Edit: remove space between the array and map method.
Filhal abhi error aa rahi hai. 15 minutes baad phir check karta hu aake. Asar ke baad.
1 Like
current code post kijye apna.