Javascrut

Páginas: 97 (24022 palabras) Publicado: 18 de febrero de 2013
By
Cody Lindley

Foreword by Daniel Jebaraj

2

Copyright © 2012 by Syncfusion Inc.
2501 Aerial Center Parkway
Suite 200
Morrisville, NC 27560
USA
All rights reserved.

I

mportant licensing information. Please read.
This book is available for free download from www.syncfusion.com on completion of a registration form.

If you obtained this book from any other source,please register and download a free copy from
www.syncfusion.com.
This book is licensed for reading only if obtained from www.syncfusion.com.
This book is licensed strictly for personal, educational use.
Redistribution in any form is prohibited.
The authors and copyright holders provide absolutely no warranty for any information provided.
The authors and copyright holders shall not be liablefor any claim, damages, or any other liability arising from, out
of, or in connection with the information in this book.
Please do not use this book if the listed terms are unacceptable.
Use shall constitute acceptance of the terms listed.

E

3

dited by
This publication was edited by Jay Natarajan, senior product manager, Syncfusion, Inc.

Table of Contents

About the Author......................................................................................................... 10
Introduction ................................................................................................................. 11
Preface ......................................................................................................................... 13
More code, less words............................................................................................... 13
Exhaustive code and repetition .................................................................................. 13
Color-coding conventions .......................................................................................... 13
Code examples.......................................................................................................... 14
Chapter 1: JavaScript Objects ................................................................................... 16
Creating objects ......................................................................................................... 16
JavaScript constructors create and return object instances....................................... 21
The native JavaScript object constructors ................................................................. 23
User-defined/non-native object constructor functions ................................................ 24
Instantiating constructors using the new operator ...................................................... 25
Creating shorthand or literal values fromconstructors............................................... 27
Primitive (aka simple) values ..................................................................................... 28
The primitive values null, undefined, "string", 10, true, and false are not
objects ....................................................................................................................... 30
How primitivevalues are stored/copied in JavaScript ................................................ 31
Primitive values are equal by value ........................................................................... 32
The string, number, and Boolean primitive values act like objects when used like
objects....................................................................................................................... 33
Complex (aka composite) values ............................................................................... 34
How complex values are stored/copied in JavaScript ................................................ 35
Complex objects are equal by reference ................................................................... 36
Complex objects have dynamic properties...
Leer documento completo

Regístrate para leer el documento completo.

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS