New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chapter10.md: some missing lines of codes #105
Comments
Excuse me for the bad formatting, still a newb to this. |
@Jemaz It seems this function uses the global variable that is declared below in that code fragment: //...
const nolanMovieList = [];
console.log(titles());
// ... |
@Jemaz About formatting, you can read here: https://help.github.com/articles/creating-and-highlighting-code-blocks/ Just use |
@vsemozhetbyt Thanks truly for the formatting advice!
|
@Jemaz I suppose both using the global variable and omitting the |
What was a bit more confusing for me: why the final |
Thanks for your feedback. This chapter gave me a lot of headaches and is probably still too confusing. I leave this issue open in case someone else can provide good advice for improving it. |
* Update Chapter 18. Very small changes to improve readability. * Revamp README * English screenshots of chap02 program * Add link to launch article * Fix typos chapter01.md Small typo fixes on chapter01: which -> whose can not -> cannot * Remove useless variable * Update contributor list * Added event listener to code example The code example didn't have an event listener, so it just executed without the need of the button click. So I added the event listener. * Add contributor * grammar fix: "a URL" I know it's minor, but URL as an abbreviation is pronounced as 'you-are-ell'. Y is a consonant, and the general rule is that 'an' is reserved for vowels, and 'a' is reserved for consonants. * Update contributor list * Fix thejsway#73 * Fix thejsway#104 * Fix thejsway#74 * (Try to) Fix thejsway#105 * Move environment setup chapter from appendices to intro * Add Amazon to README * Fix thejsway#130 * Typo fix * Fixed a tiny, tiny typo "request" was in source tags. * Update copyright and add a contributor * Update chapter24.md Fix typo line 133 * Update contributor list
At the "Splitting the program into functions", the particular code is written as:
// Get movies by Christopher Nolan const nolanMovies = () => { for (const movie of movieList) { if (movie.director === "Christopher Nolan") { nolanMovieList.push(movie); } } };
Where it should be:
// Get movies by Christopher Nolan const nolanMovies = () => { const nolanMovieList = []; for (const movie of movieList) { if (movie.director === "Christopher Nolan") { nolanMovieList.push(movie); } } return nolanMovieList; };
The text was updated successfully, but these errors were encountered: