This selects the 5th child of the body, then the 2nd child from that. This is almost like using CSS selectors to select parent and child elements.
One of the things I love about Lynda is that they recommend additional courses to learn more about related topics. A few courses the instructor recommended included:
jQuery for Web Designers
Angular 2 Essential Training
ReactJS Essential Training
I recently got through the Debugging set of lessons on FreeCodeCamp. Here are a few points I learned.
There are 3 types of errors:
Syntax – misspelled word, missing parentheses, etc.
Runtime – detected while running the program.
Semantic – detected after testing output. Program works but result is wrong. Be careful!
1. Use DevTools on Chrome or Firefox
2. Use console.log(); a lot.console.log spits out the value of whatever is in the () to the browser console, which helps you keep tabs on how a value is changing in your code. Sometimes you have to move the console.log to a different place, like before or after another function, because order matters and the value of your value can change.
3. Use console.clear(); to clear the memory of a value in the console. Sometimes it’s ok to forget.
4. Use typeof to keep track of values. For instance sometimes a number is a numeral and sometimes it’s a string. Write console.log(typeof value); and that will tell you the type for value.
5. Lastly, you have to watch out for misspellings, missing brackets or parentheses, using ‘=‘ instead of ‘==‘, or getting the dreaded infinite loop.