Imran Alam

Imran Alam

52 Articles Published

Articles by Imran Alam

Page 6 of 6

How to convert array of strings to array of numbers in JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 30K+ Views

In JavaScript, there are different ways to convert an array of strings to an array of numbers. The most common approaches include using the built-in parseInt() method, the Number() constructor, and the unary + operator. Using the parseInt() Method The parseInt() method is a built-in function in JavaScript that takes a string as an argument and returns an integer. This method can be used with the map() method to convert an array of strings to an array of numbers. Syntax parseInt(string, radix); Parameters ...

Read More

How to return a passed string with letters in alphabetical order in JavaScript?

Imran Alam
Imran Alam
Updated on 15-Mar-2026 2K+ Views

We can apply String split(), Array sort() and Array join() methods to write a function that returns a passed string with letters in alphabetical order in JavaScript. This approach converts the string into an array, sorts the characters, and joins them back into a string. Input string : tutorialspoint Output string: aiilnooprstttu Syntax function sortString(str) { return str.split("").sort().join(""); } Steps Split the string into an array of characters using split("") method. ...

Read More
Showing 51–52 of 52 articles
« Prev 1 2 3 4 5 6 Next »
Advertisements