Javascript Syntax

Total Page:16

File Type:pdf, Size:1020Kb

Javascript Syntax JavaScript Syntax Comments Comments are sections of code that you do not want to run. A single line comment is preceded by //, while multiline comments are surrounded by /* ... */: varx= 100 // This isa comment; it will be ignored when the code is run 2 vary= 50// This isa comment on the same line as some code 4 /* This isa longer 6 comment, that spans multiple lines*/ 8 Line Endings Lines of JavaScript code are separated by a return character (so each line is actually on its own line) or by a semicolon: varx= 100 vary= 50 2 vara= 20; varb= 40 Either is fine, though it's good to be in the habit of ending lines with the ; symbol. This makes it easier to \minify" your code, and put long scripts on a single line. Case Sensitivity JavaScript is a case-sensitive language, which means that the strings 'hello', 'Hello', and 'HELLO' would not be equal. JavaScript keywords, like function and for, must be written in lowercase. Quotation Marks Strings in JavaScript can be surrounded by either single or double quotation marks. var newString="I 'ma string with double quotation marks" var aNewString= 'This isa string with single quotation marks ' 2 var anotherNewString= 'AndI 'ma string with too many quotation marks ' The reason you'd want to use a mix of both can be seen in the color highlighting of the above example; the apostrophe in the word "I'm" was interpreted as the end of the string. Instead, we'll surround the string in double quotes: var anotherNewString="AndI 'ma string with too many quotation marks" Variables A variable in JavaScript can hold one of several data types, including numbers, strings, arrays, booleans, functions, objects, etc. JavaScript is a dynamic language, so we don't need to specify the type of our variable, and we can change it at any time. We assign a value to a variable using the '=' operator. varx=5 You can retrieve the type of a variable using the typeof operator: var sampleString= 'Hello world ' varx= false 2 typeof sampleString// returns 'string ' typeofx// returns 'boolean ' 4 When naming variables, begin with a lowercase letter. You can use any combination of letters and numbers, and the symbol. Do not include a space in the variable name. Data Visualization with JavaScript · Spring 2016 · JavaScript Reference JavaScript Control Flow If and If-Else Statements If statements are used to execute a block of code, given particular conditions are true. varx= 100 vary= 50 2 if(x>0 ) { alert( 'x is positive ') 4 } if(y<2){ 6 alert( 'y is small ') } 8 // there will be an alert 'x is positive ', but the second alert will not be displayed, sincey<2 is false If-else statements are used when you want one block of code to run when a statement is true, and another to run if the statement is false: varx=4 if(x<0){ 2 alert( 'x is negative ') } 4 else{ alert( 'x is not negative ') 6 } // the alert will display 'x is not negative ', sincex<0 is false 8 For even more options, use else if to test for addition conditions: varx=4 if(x<0){ 2 alert( 'x is negative ') } 4 else if(x==0){ alert( 'x is zero ') 6 } else{ 8 alert( 'x is positive ') } 10 // the alert will display 'x is positive ', since x<0 and x==0 are both false For Loops To have a block of code run a particular number of times, use a for loop. A typical for loop takes three arguments: the beginning value, the condition that must be true for the loop to continue, and the increment. for(vari= 0;i< 5;i++) { // definea variablei to be 0, and increasei by1 with each loop 2 // the loop will run untili is5(but not including i=5) console.log(i) 4 } // the console will show 0,1,2,3,4 6 for(vari= 4;i< 20; i=i+2) { 8 // definea variablei to be 4, and increasei by2 with each loop // the loop will run untili is 20(but not including i=5) 10 if(i%2==0){// check ifi is divisible by2 console.log(i)// only printi ifi%2==0 12 } } 14 // the console will show 4,6,8,10,12,14,16,18 Data Visualization with JavaScript · Spring 2016 · JavaScript Reference For loops can also be used to loop over array values or object properties using for..in: var sampleArray= [1,3,6, 'hi '] for(vari in sampleArray){ 2 console.log(i) } 4 // the console will show 1,3,6,hi var sampleObject={ 'first ': 1, 'second ':3, 'third ':'hi ' } 6 for(vari in sampleObject){ //i ranges over all property names 8 // sampleObject[i] produces the value of the propertyi var string="The value of property"+i+" is"+sampleObject[i] 10 console.log(string) } 12 // the console will show: // The value of property first is1 14 // The value of property second is3 // The value of property third is hi 16 While Loops While loops are used to execute a code block while a given condition is true. The condition is tested before the code is executed. varx=2 while(x<1){ 2 console.log(x) x++ 4 } // Nothing is printed. The condition is false to begin with, so the code will not be 6 executed. vary=2 8 while(y<10){ console.log(y) 10 y++// change the value ofy, or else the loop will never end } 12 // console will show 2,3,4,5,6,7,8,9 Do While Loops Do-while loops are used to execute a code block while a given condition is true. The condition is tested after the code is executed, in contrast to while loops. varx=2 do{ 2 console.log(x) x++ 4 } while(x<1) 6 // The console will show 2, andx is increased to 3. Then the condition is tested and found to be false, so the loop ends. 8 vary=2 do{ 10 console.log(y) y++// change the value ofy, or else the loop will never end 12 } while(y< 10) 14 // console will show 2,3,4,5,6,7,8,9,10 Data Visualization with JavaScript · Spring 2016 · JavaScript Reference Break The break command is used to stop a loop. For instance, the following code creates an array. Then we create a for loop that tests if the given value of x is in the array. If it is, we'll set a boolean value equal to true: var testArray= [1,10,2,8,3,15,11,7] varx=2 2 var xHasBeenFound= false for(vari in testArray){ 4 if(i==x){ xHasBeenFound= true 6 } } 8 // xHasBeenFound is now true Since x is actually found at index 2, there was no need to continue the search. Adding a break command will stop the loop when it's no longer necessary to run. var testArray= [1,10,2,8,3,15,11,7] varx=2 2 var xHasBeenFound= false for(vari in testArray){ 4 if(i==x){ xHasBeenFound= true 6 break } 8 } // xHasBeenFound is now true, and the loop stopped after only3 runs instead of8 10 Switch Switch statements can be more convenient that a series of if-then-else statements. Blocks of code are executed depending on the value of an expression. var breed= prompt("What kind of dog do you have?") //a pop-up will display on screen asking the question 2 // the value of breed will bea string equal to whatever the user types as their answer 4 switch( breed){ case"English Bulldog":// if the user typed English Bulldog: 6 alert("Bulldogs are courageous but gentle and were bred to bait bulls.") break;// end the switch statement, since we found the case 8 case"Clumber Spaniel": alert("Clumber spaniels are calm but affectionate and originated in France.") 10 break; case"Labrador Retriever": 12 alert("Labs are athletic and are excellent swimmers.") break; 14 case"Papillon": alert("Papillons are small but intelligent dogs with long hair and big ears.") 16 break; default:// the user entered an expression that wasn 't on our list 18 alert("Sorry,I don 't know about your dog!") } 20 Data Visualization with JavaScript · Spring 2016 · JavaScript Reference JavaScript Strings Strings in JavaScript can be any combination of letters, numbers, and symbols, surrounded by single or double quotes. var sampleString="I ama string" All strings have a length property that returns the number of characters (including whitespace) in the string: var sampleString="I ama string" sampleString.length// returns 13 2 Concatenation Two strings can be concatenated (combined into a single string) using the + symbol: var sampleString="I ama string" var longerString= sampleString+" and nowI am longer" 2 // longerString has value"I ama string and nowI am longer" You can concatenate two strings or a string and a variable or number. Anything surrounded by quotes will be interpreted literally. varx=4 vary=2 2 var firstTry="The sum ofx andy isx+y" // firstTry value is"The sum ofx andy isx+y" 4 var secondTry="The sum of"+x+" and"+y+" isx+y" // secondTry value is"The sum of4 and2 isx+y" 6 var thirdTry="The sum of"+x+" and"+y+" is"+(x+y) // secondTry value is"The sum of4 and2 is 6" 8 Useful string methods Each character in a string is given an index, starting at 0. To find the character at a particular index, use the charAt method: var sampleString="I ama string" sampleString.charAt(0)// returns"I" 2 sampleString.charAt(7)// returns"s" To find the index of a particular character or string, use the indexOf method. This will only return the first index where the character or string appears.
Recommended publications
  • Interaction Between Web Browsers and Script Engines
    IT 12 058 Examensarbete 45 hp November 2012 Interaction between web browsers and script engines Xiaoyu Zhuang Institutionen för informationsteknologi Department of Information Technology Abstract Interaction between web browser and the script engine Xiaoyu Zhuang Teknisk- naturvetenskaplig fakultet UTH-enheten Web browser plays an important part of internet experience and JavaScript is the most popular programming language as a client side script to build an active and Besöksadress: advance end user experience. The script engine which executes JavaScript needs to Ångströmlaboratoriet Lägerhyddsvägen 1 interact with web browser to get access to its DOM elements and other host objects. Hus 4, Plan 0 Browser from host side needs to initialize the script engine and dispatch script source code to the engine side. Postadress: This thesis studies the interaction between the script engine and its host browser. Box 536 751 21 Uppsala The shell where the engine address to make calls towards outside is called hosting layer. This report mainly discussed what operations could appear in this layer and Telefon: designed testing cases to validate if the browser is robust and reliable regarding 018 – 471 30 03 hosting operations. Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student Handledare: Elena Boris Ämnesgranskare: Justin Pearson Examinator: Lisa Kaati IT 12 058 Tryckt av: Reprocentralen ITC Contents 1. Introduction................................................................................................................................
    [Show full text]
  • Defensive Javascript Building and Verifying Secure Web Components
    Defensive JavaScript Building and Verifying Secure Web Components Karthikeyan Bhargavan1, Antoine Delignat-Lavaud1, and Sergio Maffeis2 1 INRIA Paris-Rocquencourt, France 2 Imperial College London, UK Abstract. Defensive JavaScript (DJS) is a typed subset of JavaScript that guarantees that the functional behavior of a program cannot be tampered with even if it is loaded by and executed within a malicious environment under the control of the attacker. As such, DJS is ideal for writing JavaScript security components, such as bookmarklets, single sign-on widgets, and cryptographic libraries, that may be loaded within untrusted web pages alongside unknown scripts from arbitrary third par- ties. We present a tutorial of the DJS language along with motivations for its design. We show how to program security components in DJS, how to verify their defensiveness using the DJS typechecker, and how to analyze their security properties automatically using ProVerif. 1 Introduction Since the advent of asynchronous web applications, popularly called AJAX or Web 2.0, JavaScript has become the predominant programming language for client-side web applications. JavaScript programs are widely deployed as scripts in web pages, but also as small storable snippets called bookmarklets, as down- loadable web apps,1 and as plugins or extensions to popular browsers.2 Main- stream browsers compete with each other in providing convenient APIs and fast JavaScript execution engines. More recently, Javascript is being used to program smartphone and desktop applications3, and also cloud-based server ap- plications,4 so that now programmers can use the same idioms and libraries to write and deploy a variety of client- and server-side programs.
    [Show full text]
  • Typescript-Handbook.Pdf
    This copy of the TypeScript handbook was created on Monday, September 27, 2021 against commit 519269 with TypeScript 4.4. Table of Contents The TypeScript Handbook Your first step to learn TypeScript The Basics Step one in learning TypeScript: The basic types. Everyday Types The language primitives. Understand how TypeScript uses JavaScript knowledge Narrowing to reduce the amount of type syntax in your projects. More on Functions Learn about how Functions work in TypeScript. How TypeScript describes the shapes of JavaScript Object Types objects. An overview of the ways in which you can create more Creating Types from Types types from existing types. Generics Types which take parameters Keyof Type Operator Using the keyof operator in type contexts. Typeof Type Operator Using the typeof operator in type contexts. Indexed Access Types Using Type['a'] syntax to access a subset of a type. Create types which act like if statements in the type Conditional Types system. Mapped Types Generating types by re-using an existing type. Generating mapping types which change properties via Template Literal Types template literal strings. Classes How classes work in TypeScript How JavaScript handles communicating across file Modules boundaries. The TypeScript Handbook About this Handbook Over 20 years after its introduction to the programming community, JavaScript is now one of the most widespread cross-platform languages ever created. Starting as a small scripting language for adding trivial interactivity to webpages, JavaScript has grown to be a language of choice for both frontend and backend applications of every size. While the size, scope, and complexity of programs written in JavaScript has grown exponentially, the ability of the JavaScript language to express the relationships between different units of code has not.
    [Show full text]
  • Learn Javascript
    Learn JavaScript Steve Suehring Copyright © 2012 by Steve Suehring All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. ISBN: 978-0-7356-6674-0 1 2 3 4 5 6 7 8 9 LSI 7 6 5 4 3 2 Printed and bound in the United States of America. Microsoft Press books are available through booksellers and distributors worldwide. If you need support related to this book, email Microsoft Press Book Support at [email protected]. Please tell us what you think of this book at http://www.microsoft.com/learning/booksurvey. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty/ Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respective owners. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Acquisitions and Developmental Editor: Russell Jones Production Editor: Rachel Steely Editorial Production: Dianne Russell, Octal Publishing, Inc.
    [Show full text]
  • Concrete Types for Typescript
    Concrete Types for TypeScript Gregor Richards1, Francesco Zappa Nardelli2, and Jan Vitek3 1 University of Waterloo 2 Inria 3 Northeastern University Abstract TypeScript extends JavaScript with optional type annotations that are, by design, unsound and, that the TypeScript compiler discards as it emits code. This design point preserves programming idioms developers are familiar with, and allows them to leave their legacy code unchanged, while offering a measure of static error checking in annotated parts of the program. We present an alternative design for TypeScript that supports the same degree of dynamism but that also allows types to be strengthened to provide correctness guarantees. We report on an implementation, called StrongScript, that improves runtime performance of typed programs when run on a modified version of the V8 JavaScript engine. 1998 ACM Subject Classification F.3.3 Type structure Keywords and phrases Gradual typing, dynamic languages Digital Object Identifier 10.4230/LIPIcs.ECOOP.2015.999 1 Introduction Perhaps surprisingly, a number of modern computer programming languages have been de- signed with intentionally unsound type systems. Unsoundness arises for pragmatic reasons, for instance, Java has a covariant array subtype rule designed to allow for a single polymor- phic sort() implementation. More recently, industrial extensions to dynamic languages, such as Hack, Dart and TypeScript, have featured optional type systems [5] geared to ac- commodate dynamic programming idioms and preserve the behavior of legacy code. Type annotations are second class citizens intended to provide machine-checked documentation, and only slightly reduce the testing burden. Unsoundness, here, means that a variable an- notated with some type T may, at runtime, hold a value of a type that is not a subtype of T due to unchecked casts, covariant subtyping, and untyped code.
    [Show full text]
  • Visual Studio “Code in Strings”
    VisCis: Visual Studio “Code in Strings” Paul Roper School of Business and Computer Technology Nelson Marlborough Institute of Technology Nelson, NZ [email protected] When developing web applications using Visual Studio .NET SQL and Javascript. This code is ignored by Visual there are times when the programmer is coding either SQL or Javascript within text strings. Consequently such code is never Studio, and consequently can be the source of run- checked for correct syntax before it is run. As far as Visual time errors. The writer wanted to see if another Studio is concerned, the contents of a string are irrelevant. As program could extract this “code in strings” and syn- long as the code is inside matching quotes, it is simply a valid string. tax check it at edit-time, potentially saving devel- There is an irony here in that Visual Studio is a sophisticated oper time and frustration. tool with powerful features for developers such as highlighting syntax errors as lines are typed. However, the SQL and 1.1 SQL in ASP.NET program code Javascript code inside strings is just as prone to errors as any other code but these errors are only discovered at run time. In SQL instructions have long been part of web terms of time taken to find and fix, they probably consume application code (Java, ASP, PHP etc). Both stu- relatively more time per lines of code than the VB or C# code that is thoroughly checked at edit-time. Both SQL and Javascript dents and experienced developers frequently expe- are necessary for any non-trivial web application although the rience problems with the syntax of embedded SQL use of stored procedures in MSSQL removes SQL code from particularly unmatched quotes, inadvertent use of a program code.
    [Show full text]
  • Formally Verifying Webassembly with Kwasm
    Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts Master’s thesis in Computer Science and Engineering RIKARD HJORT Department of Computer Science and Engineering CHALMERS UNIVERSITY OF TECHNOLOGY UNIVERSITY OF GOTHENBURG Gothenburg, Sweden 2020 Master’s thesis 2020 Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts RIKARD HJORT Department of Computer Science and Engineering Chalmers University of Technology University of Gothenburg Gothenburg, Sweden 2020 Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts RIKARD HJORT © RIKARD HJORT, 2020. Supervisor: Thomas Sewell, Department of Computer Science and Engineering Examiner: Wolfgang Ahrendt, Department of Computer Science and Engineering Master’s Thesis 2020 Department of Computer Science and Engineering Chalmers University of Technology and University of Gothenburg SE-412 96 Gothenburg Telephone +46 31 772 1000 Cover: Conceptual rendering of the KWasm system, as the logos for K ans Web- Assembly merged together, with a symbolic execution proof tree protruding. The cover image is made by Bogdan Stanciu, with permission. The WebAssembly logo made by Carlos Baraza and is licensed under Creative Commons License CC0. The K logo is property of Runtime Verification, Inc., with permission. Typeset in LATEX Gothenburg, Sweden 2020 iv Formally Verifying WebAssembly with KWasm Towards an Automated Prover for Wasm Smart Contracts Rikard Hjort Department of Computer Science and Engineering Chalmers University of Technology and University of Gothenburg Abstract A smart contract is immutable, public bytecode which handles valuable assets. This makes it a prime target for formal methods. WebAssembly (Wasm) is emerging as bytecode format for smart contracts.
    [Show full text]
  • Intro to Javascript
    1 Intro to Javascript CS380 Client Side Scripting 2 CS380 Why use client-side programming? 3 PHP already allows us to create dynamic web pages. Why also use client-side scripting? client-side scripting (JavaScript) benefits: usability : can modify a page without having to post back to the server (faster UI) efficiency : can make small, quick changes to page without waiting for server event-driven : can respond to user actions like clicks and key presses CS380 Why use client-side programming? 4 server-side programming (PHP) benefits: security : has access to server's private data; client can't see source code compatibility : not subject to browser compatibility issues power : can write files, open connections to servers, connect to databases, ... CS380 What is Javascript? 5 a lightweight programming language ("scripting language") used to make web pages interactive insert dynamic text into HTML (ex: user name) react to events (ex: page load user click) get information about a user's computer (ex: browser type) perform calculations on user's computer (ex: form validation) CS380 What is Javascript? 6 a web standard (but not supported identically by all browsers) NOT related to Java other than by name and some syntactic similarities CS380 Javascript vs Java 7 interpreted, not compiled more relaxed syntax and rules fewer and "looser" data types variables don't need to be declared errors often silent (few exceptions) key construct is the function rather than the class "first-class" functions are used in many situations contained within a web page and integrates with its HTML/CSS content CS380 Javascript vs Java 8 + = CS380 JavaScript vs.
    [Show full text]
  • Preview Javascript Tutorial
    About the Tutorial JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complimentary to and integrated with Java. JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform. Audience This tutorial has been prepared for JavaScript beginners to help them understand the basic functionality of JavaScript to build dynamic web pages and web applications. Prerequisites For this tutorial, it is assumed that the reader have a prior knowledge of HTML coding. It would help if the reader had some prior exposure to object-oriented programming concepts and a general idea on creating online applications. Copyright and Disclaimer Copyright 2015 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at [email protected] i Table of Contents About the Tutorial ............................................................................................................................................
    [Show full text]
  • Book Reviews Elizabbeth Zwicooky, with Mark Laksmourine
    Book Reviews ELIZABbETH ZWICOOKY, WITH MARK LAksMOURINE Team Geek: A Software Developer’s Guide to This is not a story I was part of, and it’s before I came to Working Well with Others Silicon Valley, so in some sense it’s not a world I know . And Brian W . Fitzpatrick and Ben Collins-Sussman yet, at the same time, it is the world I knew then (a time when O’Reilly, 2012 . 160 pp . we saved the foam that one of our computers came in because ISBN 978-1-449-30244-3 it was handy for sleeping on when you had been programming too long and needed a nap) . Furthermore, it is also the world of the most recent startup I was at . Having the stories told by The Developer’s Code: What Real Programmers Do the participants gives this a sense of truth that most tales of Ka Wai Cheung computing history don’t possess . Pragmatic Bookshelf, 2012 . 141pp . This came in (reprinted) for review right around the time ISBN 978-1-934356-79-1 Steve Jobs died, and I put off looking at it partly because of These make a nice pair; each is the programmer’s equivalent the noise at the time . Although Steve Jobs appears, this is not of a glossy management book, with simple, good advice well a book about him, and it depicts him with the full complexity packaged . Simple ideas are easy to read and easy to believe in of feelings that people had at the time . and sadly very, very hard to implement .
    [Show full text]
  • Javascript Elements Client-Side Scripting Why Use Client
    Client-side scripting JavaScript Elements • client-side script: code runs in browser a"er page is sent back from server – often this code manipulates the page or responds to user actions Copyright 2012 Marty Stepp, Jessica Miller, and Victoria Kirst 2 Why use client-side programming? What is JavaScript? • PHP already allows us to create dynamic web pages. Why • a lightweight programming language ("scripting language") also use client-side scripting? • • Client-side scripting (JavaScript) benefits: used to make web pages interactive – – usability: can modify a page without having to post back to the server insert dynamic text into HTML (ex: user name) (faster UI) – react to events (ex: page load user click) – efficiency: can make small, quick changes to page without wai?ng for – get information about a user's computer (ex: browser type) server – perform calculations on user's computer (ex: form validation) – event-driven: can respond to user ac?ons like clicks and key presses • a web standard (but not supported identically by all • Server-side programming (PHP) benefits: browsers) – security: has access to server's private data; client can't see source code – compa7bility: not subject to browser compa?bility issues • NOT related to Java other than by name and some syntactic – power: can write files, open connec?ons to servers, connect to databases, ... similarities Copyright 2012 Marty Stepp, Jessica Miller, and Victoria Kirst Copyright 2012 Marty Stepp, Jessica Miller, and Victoria Kirst 3 4 Short History of JavaScript JavaScript and JAVA
    [Show full text]
  • The Past, Present, and Future of Javascript Where We’Ve Been, Where We Are, and What Lies Ahead
    The Past, Present, and Future of JavaScript Where We’ve Been, Where We Are, and What Lies Ahead Dr. Axel Rauschmayer The Past, Present, and Future of JavaScript Axel Rauschmayer Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo The Past, Present, and Future of JavaScript by Axel Rauschmayer Copyright © 2012 Axel Rauschmayer. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or [email protected]. Editor: Mac Slocum Cover Designer: Karen Montgomery Production Editor: Melanie Yarbrough Interior Designer: David Futato Illustrator: Robert Romano Revision History for the First Edition: 2012-07-20 First release See http://oreilly.com/catalog/errata.csp?isbn=9781449339968 for release details. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. The Past, Present, and Future of JavaScript and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein.
    [Show full text]