Safa
Safa

Reputation: 74

React Native Data Types

Can we determine the data type (string, integer, boolean, etc.) of variables using react native?

For example:

class ex {
  years: integer;
  name: string;
  remember: boolean;
}

Can I decide whether the data from the form is a string or an integer?

Upvotes: 4

Views: 19580

Answers (1)

Jose Kj
Jose Kj

Reputation: 2962

yes you can find type of a variable using typeof(your variable name) Example

var name="name here";
console.log("type of variable is:"+typeof(name));

output

type of variable is: string

Upvotes: 5

Related Questions