Javascript Global Functions

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Created page with "These functions exist in the global context and can be called from anywhere. * <div id="isNaN">'''isNan(x)'''</div>")
 
Line 1: Line 1:
 
These functions exist in the global context and can be called from anywhere.
 
These functions exist in the global context and can be called from anywhere.
  
* <div id="isNaN">'''isNan(x)'''</div>
+
* <div id="isNaN">'''isNan(arg)'''</div>
 +
This function checks if ''arg'' is a number or not.
 +
 
 +
* <div id="parseInt">'''parseInt(str)'''</div>
 +
Converts a string ''str'' to a number using a default numbering base
 +
 
 +
Obeys usual programming conventions:
 +
* Strings starting with '''0x''' are hexadecimal
 +
* Strings starting with '''0''' are octal
 +
* All other strings are assumed decimal
 +
 
 +
Returns number or zero if ''str'' was not parsable.
 +
 
 +
* <div id="parseInt">'''parseInt(str,base)'''</div>
 +
Converts a string ''str'' to a number using a specific numbering ''base''
 +
 
 +
Base must be between 2 and 36.

Revision as of 16:54, 10 September 2013

These functions exist in the global context and can be called from anywhere.

  • isNan(arg)

This function checks if arg is a number or not.

  • parseInt(str)

Converts a string str to a number using a default numbering base

Obeys usual programming conventions:

  • Strings starting with 0x are hexadecimal
  • Strings starting with 0 are octal
  • All other strings are assumed decimal

Returns number or zero if str was not parsable.

  • parseInt(str,base)

Converts a string str to a number using a specific numbering base

Base must be between 2 and 36.

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers