Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Related Plugin Resources
Index

The parseInt() method


The parseInt() method accepts a string and returns the numerical value. It can be used to convert a string type to a numeric type. For float values, parseFloat() can be used:

var stringOne = "1";
var intOne = parseInt(stringOne);