Git Product home page Git Product logo

javascript6_examples's Introduction

These are examples from the book JavaScript: The Definitive Guide, 6th Edition.

See the "O'Reilly Policy on Re-Use of Code Examples from Books"
(http://www.oreilly.com/pub/a/oreilly/ask_tim/2001/codepolicy.html) for
details on how you may and may not use these examples. In most cases, it
suffices to simply provide suitable attribution, in the source code and
documentation of your program, with a comment like the following:

// This code is from the book JavaScript: The Definitive Guide, 6th Edition,
// (ISBN #978-0596805524). Copyright 2011 by David Flanagan.

Please note that the examples are not production code and have not been
carefully testing. They are provided "as-is" and come with no warranty
of any kind.

javascript6_examples's People

Contributors

davidflanagan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript6_examples's Issues

Thanks sir! But i have a problem when run permanote examples at chapter 20!

Once more time, thanks you for writing "Javascript, The Definitive Guide". I have a question, please answer me, when i upload example 20.05, 20.6, 20.7 to run permanote app, i cannot read and write data to the server by using "note" in manifest file, even i create "note" file in " / " directory. Can you explain how to run it! What do i do more after uploading three files to server!

Thanks and best regard from me!

shouldn't the constructor be passed instead?

@davidflanagan in examples/09.12.SingletonSet.js line: 11, shouldn't SingletonSet be passed to extend instead of SingletonSet.prototype ?

Additionally if extend is defined like this:
Function.prototype.extend = function(){}
shouldn't it be used with Set.extend instead of Set.prototype ?

So, from this:

// Now add properties to the prototype.
// These properties override the properties of the same name fro
Set.prototype.extend(SingletonSet.prototype, {...

To this

// Now add properties to the prototype.
// These properties override the properties of the same name fro
Set.extend(SingletonSet.prototype, {...

I don't know if it's an error or it's something I don't get from the chapter. This has been driving me nuts for a couple of days! Thanks.

one confused question

I love your book so much,it's not only broad also deep,make me think a lot and less confusion.I also preview the 7edition on oreilly,It's also great.I can't wait to own one.But it seems to be take a long time to buy in China.

I have a question to consult you.

var a = {n: 1};
var b = a;
a.x = a = {n: 2};
console.log(a.x);
console.log(b.x);

it is a interview question from internet,and there is a lot of explanations about how to get the result.Most of them just can't convince me.
I have read several times about operator precedence ,order of evaluation part from "the definitive guide", I'm so stuck.

obviously,the key is the third line.
one explanation is "a.x" uses member access(high precedence),so it will evaluate first,it is why "b"and"a" become{n:1;x:undefined},
then the assigment, it has right-to-left associativity,make "a" become a new object{n:2},then assign {n:2} to a.x
Another explanation is order of evaluation,subexpressions will evaluate left-to-right,so "a.x" will evaluate first。

I want to ask some questions

  • the reason about why "a.x" evaluate first,the above explanations are all right?the interpreter(compiler) will use two rules to decide?
  • what happened when "a.x" evaluating?I found something about property accessor ,it says left-hand operand produces a reference,is this mean a new reference which equals to "a.x" ,ecma-262.

maybe it's just because my shortcoming of compiler and interpreter,I really need someone help me .
Thank you!I'm looking forward to your reply.

Questions about the JavaScript Authoritative Guide Sixth Edition

Hello, I saw in the introduction to the 75th page of the JavaScript Authoritative Guide(Rhino book): About strict equality operators, if both values are null or both are undefined, they are not equal, but I am in Chrome ( The result in the version is 75.0.3770.100) is like this, because i can't find your mailbox, so ask a question here, sorry, bothering

null===null // true
undefined===undefined // true

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.