• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

convert variable to type

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
stargateatlantis
Asked:
stargateatlantis
1 Solution
 
Gurvinder Pal SinghCommented:
so how do you want the end result to be stored in a variable?
0
 
Michel PlungjanIT ExpertCommented:
typeof "" is string
typeof "9" is string
typeof 9 is number

What exactly are you asking?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now