Array with number vs Typed Array where the type is number

October 16, 2019
Been a ColdFusion Developer since 1996
Wizard 23 posts
Followers: 13 people
Web Developer
0

Array with number vs Typed Array where the type is number

Been a ColdFusion Developer since 1996
Wizard 23 posts
Followers: 13 people
October 16, 2019

I have the following code

<cfscript>

data = [‘2342bas’, ‘asqwerewq’, ‘12314’, 12421, 1.1];

newdata = arrayNew[‘Numeric’](1);

for (item in data) {
newdata.append(val(item));
}

writedump(newdata);

newdata = [];

for (item in data) {
newdata.append(val(item));
}

writedump(newdata);
</cfscript>

This result in

Not sure this is wrong, but it is interesting

Comments (0)
Add your comment