Summary


JavaScriptCoffeeScriptRubyAssemblyCC++GoElixirErlangLanguagesFrameworkSummary

js.js



Object-Oriented JavaScript - ojs

4 - Objects
• p93-148 - array [] (array literal notation) key index from 0, elements - object {} (object literal notation) free defined keys, properties - var array = ["a", "b"...]; - var object = {a: 1, b: "two"...}; - key can be put in quotation marks: var o = {prop: 1}; --- var o = {"prop": 1}; --- var o = {'prop': 1}; - better not quote - must quote reserved words, spaces and special characters or start with number, not if letter number underscore - will learn other notations later
• p96 - access object properties 2 ways: square bracket notation: hero['occupation'] - dot notation: hero.occupation - better dot, no dot if property name not valid, rules like quote
• functions in objects are methods, array can carry functions, too, but it's no common use: var a = []; a[0] = function(what){alert(what);}; a[0]('Boo!'); //> alert: Boo! - some programming languages distinct between normal array (also called indexed, enumerated, keys are numbers) and associative array (also called hash, keys are strings), for hash in JS we use object - non-existing property //> undefined - 'Hair color is ' + hero.hair_color; //> "Hair color is undefined"
• objects can contain any data, including other objects: var book = {name: 'Catch-22', published: 1961,author: {firstname: 'Joseph', lastname: 'Heller'}};
• different ways to get property: book.author.firstname //> "Joseph" --- book['author']['lastname'] //> "Heller" --- book.author['lastname'] //> "Heller" --- book['author'].lastname //> "Heller"
• we need square brackets if name of property we need to access is not known beforehand - during runtime, it is dynamically stored in a variable: var key = 'firstname'; book.author[key]; //> "Joseph"
• p97 - method is property that happens to be a function, we can access methods in same way as we would access properties: using dot notation or using square brackets - as calling any other function: add parentheses after method name says "Execute!": var hero = {breed: 'Turtle', occupation: 'Ninja', say: function() {return 'I am ' + hero.occupation;}}; hero.say(); //> "I am Ninja" - passing parameters as with normal functions: hero.say('a', 'b', 'c'); - can also use brackets to access and invoke methods, but no common practice: hero['say']();
• tip: No quotes 1. dot notation to access methods and properties 2. don't quote properties in your object literals
• p98 - JS dynamic language, can alter values, properties, methods, add new or delete at any time - hero.name = 'Leonardo'; hero.sayName = function() {return hero.name;}; delete hero.name; //> true
• p99 - this inside of method says "this object" or "the current object" - return this.name;








<<< Current Working Area <<<














Effective JavaScript

effectivejs.com - David Herman - TW 10.1K - Amazon - Published Nov 26, 2012 by Addison-Wesley Professional - Foreword by Brendan Eich - The Future of JavaScript YT

Contents

1 - Accustoming Yourself to JavaScript - Item 1-7 - 1
2 - Variable Scope - Item 8-17 - 31
3 - Working with Functions - Item 18-29 - 57
4 - Objects and Prototypes - Item 30-42 - 83
5 - Arrays and Dictionaries - Item 43-52 - 113
6 - Library and API Design - Item 53-60 - 143
7 - Concurrency - Item 61-68 - 171
Index - 201-206

xv - book concerned with the pragmatics of JS - not an introductory book; I assume you have some familiarity with JavaScript in particular and programming in general - excellent introductory books: jsg - ejs - goal with this book is to help deepen our understanding of how to use JavaScript effectively to build more predictable, reliable, and maintainable JS applications and libraries
xvi - JS only lang with built-in support in major browsers for client-side app scripting - also implementing server-side apps with the advent of the Node.js platform - book about JS, not web programming - ch 7 describes concurrency - xvii - Acknowledgements: Brendan Eich, John Resig etc. - for Lisa Silveria, my Love - xix - Author: senior researcher at Mozilla Research - BA in computer science from Grinnell College and an MS and PhD in computer science from Northeastern University - David serves on Ecma TC39, the committee responsible for the standardization of JavaScript

1 - Accustoming Yourself to JavaScript

p1/200 + Index Items 1-7/68 - as approachable as JavaScript is, mastering the language takes more time, and requires a deeper understanding - each chapter of this book covers different thematic area of effective JavaScript- first chapter begins with some of the most fundamental topics

Item 1: Know Which JavaScript You Are Using

THE VERY BEST BOOKS ON JAVASCRIPT

Vocabularies

1/1 - one whole
7/8 - seven over eight, seven out of eight, seven eighth
altitude - Höhenlage, Höhe ...
numerator - Zähler
perimeter - Umfangslänge
denominator - Nenner
elevation - Bodenerhebung
gravel - Kies



Vocabularies

scope - Bereich, Spielraum, Umfang, Geltungsbereich, Reichweite, Handlungsspielraum, Abgrenzung, Aufgabenbereich, Bandbreite, Betätigungsfeld, Entfaltungsmöglichkeiten, Rahmen, Raum, Regelungsbereich ...


old

aggregation - Ansammlung, Anhäufung, Verdichtung, Gesamtsumme, Aggregat, Aggregation, Vereinigung, Zusammenfassung - ch1
hence - daher, deswegen, folglich, demzufolge, infolgedessen ab jetzt ... ch2
implementation - Umsetzung, Ausführung, Anwendung, das Implementieren, Inkraftsetzung, Durchführung ...- ch1
indispensable - unabdingbar, unerlässlich, unumgänglich, lebensnotwendig ... - ch1
instance - ch1
leverage - zum Durchbruch verhelfen, wirksam einsetzen ... - ch1
parentheses - Klammern
plrthora - Unmenge, Vielfalt, Überfluss ... - ch1
property - Eigenschaft, Merkmal ... - properties - Verhalten, Bestandteile, Wirkung, Wirksamkeit ... - ch1
notion - Idee ... - ch1
tweak - optimieren, zwicken - ch1

<span> - spanned text (small) --- <div> - division (large) stackoverflow.com
&nbsp; - non-breaking space

1/1 - one whole
7/8 - seven over eight, seven out of eight, seven eighth
altitude - Höhenlage, Höhe ...
numerator - Zähler
perimeter - Umfangslänge
denominator - Nenner
elevation - Bodenerhebung
gravel - Kies



Links






More coming soon :-)



Website counter