Assuming you have an array in a string format, you can use the following regex to match all the decimals and then use .map(Number)

const str = "['6.35', '2.72', '11.79', '183.25']",
      array = str.match(/\d+(?:\.\d+)?/g).map(Number)

console.log(array)

Answer from adiga on Stack Overflow
๐ŸŒ
Favtutor
favtutor.com โ€บ articles โ€บ convert-string-to-float-javascript
Convert String to Float in JavaScript (5 Easy Ways)
November 30, 2023 - Understand how to do conversion of string to float in javascript using parseFloat, unary plus operator, number() function etc.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-convert-string-into-float-in-javascript
How to convert string into float in JavaScript? - GeeksforGeeks
July 12, 2025 - In this method, we will use the parseFloat() method which is an inbuilt function in JavaScript that is used to accept the string and convert it into a floating point number.
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_parsefloat.asp
JavaScript parseFloat() Method
The parseFloat() method parses a value as a string and returns the first number. If the first character cannot be converted, NaN is returned.
๐ŸŒ
EDUCBA
educba.com โ€บ home โ€บ software development โ€บ software development tutorials โ€บ javascript tutorial โ€บ javascript string to float
JavaScript String to Float | Two Methods to Convert String to Float
March 27, 2023 - This method uses the JavaScript Type Conversion function to convert the string type to float.
Call ย  +917738666252
Address ย  Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
๐ŸŒ
Dirask
dirask.com โ€บ posts โ€บ JavaScript-convert-string-array-to-float-array-DWkWBD
JavaScript - convert string array to float array
// ONLINE-RUNNER:browser; const strings = ['1.1', '2.2', '3.14']; const numbers = strings.map(parseFloat); console.log(JSON.stringify(strings)); // ["1.1", "2.2", "3.14"] console.log(JSON.stringify(numbers)); // [1.1, 2.2, 3.14] JavaScript - convert integer array to string array
Find elsewhere
๐ŸŒ
Flexiple
flexiple.com โ€บ javascript โ€บ parsefloat-javascript
parseFloat JavaScript: Syntax and Examples - Flexiple
In this blog, let us understand the syntax, usage, and examples of the JavaScript parseFloat() function. The parseFloat() function is used to accept a string and convert it into a floating-point number.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-convert-string-into-float-in-javascript
How to convert string into float in JavaScript?
We can convert a string into a float using the parseFloat() function or the Number() constructor in JavaScript. Other approaches such as using + operator, eval() and parseInt() methods, can also be used for this. Converting strings to floating point numbers is a typical operation in JavaScript.
๐ŸŒ
TutorialKart
tutorialkart.com โ€บ javascript โ€บ javascript-convert-string-to-float
How to convert String to Float in JavaScript?
September 23, 2021 - To convert a string to float in JavaScript, call parseFloat() function and pass the string as argument to it.
๐ŸŒ
HScripts
hscripts.com โ€บ tutorials โ€บ javascript โ€บ string-float.php
Javascript (JS) Tutorial - type convert string to float, integer to string value
d) Converting Integer/Float to String Integer (int) or float value can be converted to string by using the function or method toString(). ... <script language="javascript"> var a = 32; var b = 333; var c = a.toString()+b; document.write(" to String function "+c); </script>
๐ŸŒ
Copahost
copahost.com โ€บ home โ€บ javascript parsefloat: examples and variations of this function
Javascript parseFloat: Examples and variations of this function - Copahost
July 16, 2023 - The function parses the string and returns the floating-point number 3.14. In JavaScript, the parseFloat() function is used to convert a string representation of a number into a floating-point number.
๐ŸŒ
Udemy
blog.udemy.com โ€บ home โ€บ javascript parsefloat: a simple way to convert strings into floating point numbers
JavaScript parseFloat: a simple way to convert strings into floating point numbers - Udemy Blog
December 4, 2019 - The function parsefloat is applied in such cases in JavaScript. The parsefloat converts strings into floating point numbers so that you can perform mathematical operations on them.
๐ŸŒ
Reddit
reddit.com โ€บ r/javascript โ€บ converting a string to a float in javascript?
r/javascript on Reddit: Converting a string to a float in Javascript?
March 27, 2015 -

I can't use parseFloat(). I am so far doing the obvious by checking each character, but I feel there has to be a more elegant way! My function needs to act exactly the same as parseFloat() does. Can anyone help?

๐ŸŒ
Flexiple
flexiple.com โ€บ javascript โ€บ string-to-number
How to Convert a String to a Number In JavaScript - Flexiple
To convert a string to a number in JavaScript, you can use the parseFloat() function. This function parses a string argument and returns a floating point number.