GithubHelp home page GithubHelp logo

jsninja2's People

Contributors

daz4126 avatar simonmackie 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsninja2's Issues

Chapter 7 focus and blur events

When adding the focus and blur event listeners then previewing the search.html, multiple alert windows keep opening. I have to just close the page because I can't go any further. Is there a way to make it so just 1 alert happens?

const form = document.forms[0];
const input = form.elements.searchInput;
//input.addEventListener('focus', () => alert('focused'), false);
//input.addEventListener('blur', () => alert('blurred'), false);
input.addEventListener('change', () => alert('changed'), false);
form.addEventListener('submit', search, false);

function search (event) {
alert('Form Submitted');
event.preventDefault();
}

they are commented out so I can keep going. This is happening in Chrome. I haven't checked Firefox.

Typo on page 227

There is something wrong. There is something wrong. ๐Ÿ˜†


24

Chapter 7 -- Quiz Ninja -- CodePen and archive incorrect

The CodePen link to the live example for adding the "Click to Start" button does not actually show such a button. The code does not match what the chapter says needs to be added.

Using a downloaded copy of the archive's main.js file, gets the following error:

main.js:78 Uncaught TypeError: Cannot read property 'addEventListener' of null

Jen

Wrong indices in Nested For Loops

I think that there is a problem with the indices in page 122.

for(let i=1 ; j<13 ; i++){
for(let i=1 ; j<13 ; j++){
    console.log(`${j} multiplied by ${i} is ${i*j}`);
    }
}

I think that the correct example should be the one below, or maybe I am missing something.

for(let i=1 ; i<13 ; i++){
for(let j=1 ; j<13 ; j++){
    console.log(`${j} multiplied by ${i} is ${i*j}`);
    }
}

Chapter 12 links for fetch returning errors

When trying to do the example on pages 523-527, click either the numbers or chuck buttons and an error is returned: net::ERR_CONNECTION_RESET. Is there updated URLs or code?

chapter 15 not getting bundle.min.js and errors when running builg

I've finished chapter 15 and am trying to run the build. When I run the command npm run build in the quiz directory, I get the following errors:
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: webpack --progress --colors --profile
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I looked in the dist folder and there is not a bundle.min.js file. What is happening and how do I fix it?

?typo p134

top of p134

There seems to be a line missing before the line

<< 'hello'

?typo p236

top of p236

wonderWoman.classList.toggle('sport'); // will add the
โžฅ 'hero' class back
<< true

Doesn't that add the class sport?

Typo on p 255

a support ticket suggests the following correction to page 255 in JavaScript Novice to Ninja, 2nd Edition:

==== Correction ====

wonderWoman.classList.toggle('hero'); // will remove the
โžฅ 'hero' class
<< false
wonderWoman.classList.toggle('sport'); // will add the
โžฅ 'hero' class back
<< true

"sport" needs to be changed to "hero"

?typo p201

bottom of p201

Notice that the backslash character needs to be used twice in the last example.

Unless I'm missing something there are no backslashes in the last example!!

typo on p 571

The line of code that reads

** NEW HIGH SCORE! **');

should be

view.render(view.info,'** NEW HIGH SCORE! **');

Bracket instead of Parenthesis

I think that there is a small mistake on pg 168
const ironMan = ( name: name, realName: realName };
should be
const ironMan = { name: name, realName: realName };

Please let me know if this the right way to point mistakes or if I should email you.

typo p44

bottom of p44 it says

Variables that start with an underscore, generally refer to private properties and
methods, so it's best to not follow this convention for your own variable names.
The $ character is also used by the popular jQuery library, so using this in your
variable names may also cause problems.

This is a repeat of what is in an earlier pull-out. Does it really belong here too?

Error in code on page 470

On page 470, in the example for adding methods to the Number prototype, the code to add the functions is correct:
Number.prototype.isEven = function() { return this%2 === 0; } Number.prototype.isOdd = function() { return this%2 === 1; }

However the code in the next block showing how to invoke the newly added functions on numbers will throw a syntax error (tested in JSBin and node console via Terminal). The book has:
42.isEven() << true 765234.isOdd() << false

Since the method is being called on an integer, there should be two dots:
42..isEven() << true 765234..isOdd() << false

Anyhow, loving the book, but this threw me off so I wanted to post an issue here for future revisions/releases, or in case this trips up anyone else.

Also, if there's a better place to post this, let me know and I'll be happy to revise or resubmit.

typo p 40

bottom of p40 (last but 3 line) it says "But then a is defined inside the local block using let."

Is it? It looks like it was defined using const.

P380 Testing and debugging

Tests exceptions with Jest (on node.js):

it('should throw an exception for non-numerical data', ()=> { expect(factorsOf('twelve').toThrow(); });
is incorrect.
It should be:
it('should throw an axception for non-numerical data', () => { expect( () => factorsOf('twelve').toThrow()); });

p155 reduce() in array

Hello. there is an error in the exemple of use of reduce() in Array.
[1,2,3,4,5].reduce( (acc,val) => prev + val ); << 15
I think it's better with
[1,2,3,4,5].reduce( (acc,val) => acc + val ); << 15

Chapter 4 - mean with callback not works

JS novice to Ninja >>> node

function mean(array, callback) {
... if (callback) {
..... array.map(callback);
..... }
...
... const total = array.reduce((a, b) => a + b);
... return total / array.length;
... }
undefined
mean([8, 4, 7, 9], x => x*2);
7
mean([8, 4, 7, 9]);
7

After adding fetch to main.js, answers are wrong

In Chapter 12 Ninja Project, after adding fetch, the answers on the quiz are incorrect. I'm no master on superheros so I don't know the real answers but the three you can choose from do not contain the name that is given when you get the answer wrong. I have included some screen shots to show you what is happening. I even copied the code from the file here and it does the same thing.
screen shot 2018-12-26 at 7 13 59 pm
screen shot 2018-12-26 at 7 14 06 pm
screen shot 2018-12-26 at 7 14 12 pm

Wrong function name

From page 162 and so on, the author refers to a function called play(), when he actually meant start().

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.