to produce special effect t description new line

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: uotes). Another approach (Escape Sequence) see next page. (CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong http://www.cs.cityu.edu.hk/~helena 4. Program Structure III - 17 Data Types Escape Sequences A method to represent special characters by combining backslash (\) with another character: Escape sequence \n "Escape away" from normal interpretation. -- to produce special effect \t \\ \" \' Description new line tab backslash Double quote Single quote Example: alert( 'I\'m ' means beginning of the string Happy!'); ' means end of the string \' is treated as the single quote character in the string, not to mean end of string. (CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong http://www.cs.cityu.edu.hk/~helena 4. Program Structure III - 18 Data Types Conversions between numbers and strings: toString : convert a number to a string with a given radix. Example: (45).toString(16) means to convert 45 to hexadecimal, giving "2d". x.toS...
View Full Document

This note was uploaded on 03/10/2012 for the course CS 1301 taught by Professor Dr.wong during the Winter '08 term at City University of Hong Kong.

Ask a homework question - tutors are online