+ 1
How can I get an array of numbers of 10 figures? in Js
Asking for Only javascript developers
6 Respuestas
+ 2
const nums10digits = array.map(a => a.match(/^\d{10}$/));
+ 1
You should've known all these things from the JavaScript course.
Head there and check out the for loops section to be reminded how to make one, and the rest I have already given you in my answer.
0
You could make a new array (array = [];) and then use a for loop and array.push() to add the elements in the loop. Should work w/ any number.
0
Could you show plz Coder's Crux?
0
Calviղ You've not only spoonfed him the code, but you also made it a one liner, which makes it tougher to understand for beginners. That's your choice on the matter, but please don't give people the answer straight away.
0
Coder's Crux If you are here for long, you would understand I always help beginners by given solutions, especially the simple question like this.
This is the simple map method oneliner, it's best to demonstrate for beginners to learn to write effective codes.