Solved

convert variable to type

Posted on 2011-09-10
2
281 Views
Last Modified: 2012-06-22
I am trying to figure out how to let's say you have a array

var myArray={"startVa"l:0,"readOnly":true,"imagePath":/images};

What I am having problems is loading the following values into another array but with the proper type def.  So if the value is a string then the typeof is a string if the value is a interger then the value is a integer loaded
Into the new array also if Boolean as well
0
Comment
Question by:stargateatlantis
2 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36517975
so how do you want the end result to be stored in a variable?
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 36518137
typeof "" is string
typeof "9" is string
typeof 9 is number

What exactly are you asking?
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question