Solved

convert variable to type

Posted on 2011-09-10
2
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

632 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