davidflanagan / javascript6_examples Goto Github PK
View Code? Open in Web Editor NEWExamples from JavaScript: The Definitive Guide, 6th Edition
Examples from JavaScript: The Definitive Guide, 6th Edition
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.
Any pointers or speculation on this? Thanks!
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!
@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.
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
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.