The way you care every details is not only applied to javascript, everyone who want to use programming to do or change something should come here to learn the craftsmanship from you. Thank you.
Hi Steve, Thanks for the video. Anwy, I still don't understand about and \f. Could you please explain more about escape sequences, maybe part II of this video :D Take care
Escape sequences are just a way of embedding special characters inside strings. is a new line. \t is a tab. \\ is a \. is a carriage return (similar to the new line just depends on which OS you are using). \f is formfeed (which is good for printers but useless in the terminal).
i noticed if i put the `log` shortcut at the bottom of the file, it doesn't get hoisted, and when i use it i get `Cannot access 'log' before initialization` Why? In your hoisting lesson you taught that - variable declaration is hoisted but not it's assignment. - definition of a function is hoisted, but not a function expression. According to that lesson, therefor, because this isn't getting hoisted, it's either a variable assignment, or a function expression. `log=console.log` Which one? It doesn't look like either a variable assignment, or a function expression, to me. Thx!
Hoisting with let and const work slightly differently than with var and function declarations (which is first hoisting tutorial from a few years ago) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-cHyydUnsaWI.html
I call it an alias, but I have heard people use shortcut as well. You can create aliases for any function or property. It has to do with how JS handles primitives vs objects. Primitives - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fLKzh4L00TI.html Deep vs shallow copies - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-duyshh9Fs1U.html
I've got a serious problem, not only with JS, but html and python3 can't seem to recognize utf-8 either. Windows 10 regional settings were okay, but I added utf-8 support and the problem remains. I'm pulling my hair out. LOL. 😀
Without the let (or var or const) the variable will be created in the global scope and also be added as a property of the window object. Neither of which are likely what you want. It's like a safety catch. To avoid doing this by mistake, add "use strict"; to the top of your JS file.
@@SteveGriffith-Prof3ssorSt3v3 Why wouldn't i want a shortcut to console.log created in the global scope or added as a property of the window object? i thought 'use strict' is only for older browsers thx
Yes. You can do that. One that you will see people using (who used to use jQuery or the prototype library) is: let $ = document.querySelector( ) let $$ = document.querySelectorAll( )
@@SteveGriffith-Prof3ssorSt3v3 What am i doing wrong? With parens, i get: "TypeError: Failed to execute 'getElementById' on 'Document': 1 argument required, but only 0 present. Without parens i get: "TypeError: Illegal invocation