Solved

convert variable to type

Posted on 2011-09-10
2
265 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
Comment Utility
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
Comment Utility
typeof "" is string
typeof "9" is string
typeof 9 is number

What exactly are you asking?
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
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…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now