Presentation is loading. Please wait.

Presentation is loading. Please wait.

 How do you represent a number with no value?  Mathematicians defined the “number” 0 (zero)  How do we represent a string with no value?  Use an empty.

Similar presentations


Presentation on theme: " How do you represent a number with no value?  Mathematicians defined the “number” 0 (zero)  How do we represent a string with no value?  Use an empty."— Presentation transcript:

1

2  How do you represent a number with no value?  Mathematicians defined the “number” 0 (zero)  How do we represent a string with no value?  Use an empty string  What is an empty string?  String of length zero  Defined as “”  Open and close quote with no characters between  Often used to initialize a string variable that will be used later 2Programming Part IV

3  Two string-related functions for dealing with ASCII values .charCodeAt(i)  Returns the ASCII value for the character at index i  Returns the ASCII value as a Number (decimal)  “abcd”.charCodeAt(2) → 99 (ASCII value for “c”)  String.fromCharCode(i)  Returns a single-character string  Character is the ASCII character at code i  Character code can be in decimal or hex  String.fromCharCode(99) → “c”  String.fromCharCode(0x63) → “c”  (99 = 0x63) 3Programming Part IV

4  Random password generator  Lowercase conversion 4Programming Part IV


Download ppt " How do you represent a number with no value?  Mathematicians defined the “number” 0 (zero)  How do we represent a string with no value?  Use an empty."

Similar presentations


Ads by Google