JavaScript Objects.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Characters and Strings.
Session 8 JavaScript/Jscript: Objects Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Fundamentals of Strings and Characters Characters.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
1 JavaScript/Jscript 6 Objects. 2 Introduction Up till now –JavaScript used to illustrate basic programming concepts JavaScript can also –Manipulate every.
ASP.NET Programming with C# and SQL Server First Edition
JavaScript, Third Edition
 2004 Prentice Hall, Inc. All rights reserved. Chapter 12 - JavaScript: Objects Outline 12.1 Introduction 12.2 Thinking About Objects 12.3 Math Object.
Introduction to scripting
Chapter 4 – The Building Blocks Data Types Literals Variables Constants.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
C How to Program, 6/e © by Pearson Education, Inc. All Rights Reserved.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
1 JavaScript: Objects and Object Models October 25, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel,
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Chapter 3: Data Types and Operators JavaScript - Introductory.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
INE1020: Introduction to Internet Engineering 3: Web Page Authoring1 Lecture 6: Introduction to Javascript II r Javascript Objects Array String Date Math.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Objects.
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 13 – JavaScript/Jscript: Objects Outline 13.1Introduction 13.2Thinking About Objects 13.3.
CS346 Javascript -3 Module 3 JavaScript Variables.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Chapter 7: Characters, Strings, and the StringBuilder.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e. 2.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
 2001 Deitel & Associates, Inc. All rights reserved. 1 Chapter 18 – JavaScript/Jscript: Objects Outline 18.1Introduction 18.2Thinking About Objects 18.3.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Strings See Chapter 2 u Review constants u Strings, concatenation and repetition 1.
Creating PHP Pages Chapter 6 PHP Variables, Constants and Operators.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Chapter 8 Characters and Strings. Objectives In this chapter, you will learn: –To be able to use the functions of the character handling library ( ctype).
Chapter 14 JavaScript: Part II The Web Warrior Guide to Web Design Technologies.
Characters and Strings
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
JavaScript: Objects 1 © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Strings, Characters, and Regular Expressions Session 10 Mata kuliah: M0874 – Programming II Tahun: 2010.
REEM ALMOTIRI Information Technology Department Majmaah University.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
JavaScript Tutorial. What is JavaScript JavaScript is the programming language of HTML and the Web Programming makes computers do what you want them to.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Random Functions Selection Structure Comparison Operators Logical Operator
Java Script: Objects (Chapter 12 in [2]). 2 Outline Introduction Introduction Thinking About Objects Thinking About Objects Math Object Math Object String.
Java Programming: Guided Learning with Early Objects Chapter 1 Basic Elements of Java.
11 JavaScript: Objects.
Chapter 6 JavaScript: Introduction to Scripting
Strings, StringBuilder, and Character
Scope, Objects, Strings, Numbers
Introduction to Scripting
JavaScript Syntax and Semantics
Web Programming– UFCFB Lecture 19-20
JavaScript.
Primitive Types Vs. Reference Types, Strings, Enumerations
Chapter 8 JavaScript: Control Statements, Part 2
Part a: Fundamentals & Class String
WEB PROGRAMMING JavaScript.
JavaScript: Objects.
JavaScript: Introduction to Scripting
CIS 136 Building Mobile Apps
11 JavaScript: Objects.
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

JavaScript Objects

Math Object

String Object Fundamentals of Characters and Strings Characters are the building blocks of JavaScript programs. Every program is composed of a sequence of characters grouped together meaningfully that’s interpreted by the computer as a series of instructions used to accomplish a task. A string is a series of characters treated as a single unit. A string may include letters, digits and various special characters, such as +, -, *, /, and $. A string is an object of type String. String literals or string constants are written as a sequence of characters in double or single quotation marks as A String may be assigned to a variable in a declaration. var color = "blue"; Strings can be compared via the relational (<, <=, > and >=) and equality operators (==, ===, != and !==).

Methods of the String Object It provides many methods (behaviors) that accomplish useful tasks such as selecting characters from a string, combining strings (called concatenation), obtaining substrings (portions) of a string, searching for substrings within a string, tokenizing strings (i.e., splitting strings into individual words) and converting strings to all uppercase or lowercase letters.

Character-Processing Methods

Searching Methods

Splitting Strings and Obtaining Substrings

Date Object JavaScript’s Date object provides methods for date and time manipulations. These can be performed based on the computer’s local time zone or based on World Time Standard’s Coordinated Universal Time (abbreviated UTC)— formerly called Greenwich Mean Time (GMT). Most methods of the Date object have a local time zone and a UTC version.

document Object The document object, is provided by the browser and allows JavaScript code to manipulate the current document in the browser.

Boolean and Number Objects JavaScript provides the Boolean and Number objects as object wrappers for boolean true/false values and numbers, respectively. When a JavaScript program requires a boolean value, JavaScript automatically creates a Boolean object to store the value. JavaScript programmers can create Boolean objects explicitly with the statement var b = new Boolean( booleanValue ); The booleanValue specifies whether the Boolean object should contain true or false. If booleanValue is false, 0, null, Number.NaN or an empty string (""), or if no argument is supplied, the new Boolean object contains false. Otherwise, the newBoolean object contains true.

JavaScript automatically creates Number objects to store numeric values in a script. You can create a Number object with the statement var n = new Number( numericValue ); The constructor argument numericValue is the number to store in the object.