Solved

convert variable to type

Posted on 2011-09-10
2
290 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

821 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