current position:Home>Winter Vacation JavaScript Tutorial Chapter 1 Variable Promotion
Winter Vacation JavaScript Tutorial Chapter 1 Variable Promotion
2023-01-25 10:50:20【small fish programmer】
In fact, the previous posts here have talked about a lot of js prefixes, so I won’t talk about the prologue. In a word, when practicing code, no matter who you are, you can’t do without typing and writing, although some people may have cv problems in their work, I’m asking you a question, if it’s not a boss, what’s the use of his cv, as the saying goes, there are tens of thousands of Baidu articles, just to find the answer, study in the early stage, and in the later stage is for work needs, after all, you will encounterAll kinds of weird mistakes, you are not artificial AI, so why not go to Baidu to find the exclusive answer cv to solve the work needs, what are you doing? You have learned it, and you will do the same.
Let's get back to business. We said before that js and node are two different things, one front end and one back end. At the same time, the first chapter we are talking about today is variable promotion
The working principle of JavaScript is to compile and then execute. During the compilation process, the interpreter will "move" all declarations to where top of scope, while assignment or other logic is left in place,This is variable hoisting.
2. Function priority
During hoisting, function declarations are hoisted first, followed by variables.Only function declarations ( function a(){} ) are hoisted, function expressions ( var a = function b(){} ) are not hoisted.If there are identical declarations, the same variable declarations will be ignored; for the same function declarations, the later ones will override the former ones.
For example
foo(); // 1var foo;function foo(){console. log(1);}foo = function(){console. log(2);}
will be understood as
function foo(){console. log(1);}foo(); // 1foo = function(){console. log(2);}
copyright notice
author[small fish programmer],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2023/025/202301251040055638.html
The sidebar is recommended
- Freespire 9.0 released, Ubuntu-based Linux distribution
- k8s kubeadm init error "unknown service runtime.v1alpha2.RuntimeService"
- Spring Boot Admin 3.0 Released, Admin UI for Spring Boot Applications
- Android 14 will prohibit sideloading of some apps
- uninstall docker
- The relationship between the library, schema and table space of the National People's Congress Jincang database
- sqlalchemy DetachedInstanceError: Instance
is not bound to a Session - k8s dashboard deployment
- Management system template source code based on Echo+Vue+ElementUI
- Based on the Echo + + the Vue ElementUI electrical contractor background management system
guess what you like
[Self-study on the principles of artificial intelligence] Deep Learning: Magical Deep Learning
Linux system installed jmeter
[linux] Several ways to check the version information of Linux system
Control statements perfect small lucky draw program - basic knowledge of Java
7.Java Judgment and Loop + Interview-related Deduction Algorithm Questions Detailed Explanation
Java introduction and environment construction
Analysis of Crash Principle in Java Layer for Crash Optimization
Build a local Maven warehouse
Based on VirtualBox centos7 virtual machine installation
JVM process cache - Caffeine
Random recommended
- Background management system scaffolding built by Revel+Vue+ElementUI framework
- Replace source of ubuntu virtual machine and configure Samba server
- Code Caprice No24 | Backtracking Algorithm Theoretical Basis, 77. Combination
- The Road to Algorithm Practice——[String] Leetcode 824 Goat Latin
- Git summary - Prompt to submit or temporarily store changes when switching to a branch
- Productivity tools - [gitlab configuration] One-time configuration of GitLab account
- Echo+Vue+ElementUI management background source code
- Revel+Vue+ElementUI framework use and build tutorial
- Basic practice tutorial of Revel+Vue+ElementUI framework
- Go Web Development Revel+Vue+ElementUI Framework Practical Tutorial
- Construction and deployment tutorial of Revel+Vue+ElementUI framework
- 8. Java loop advanced comprehensive exercises - infinite loop and jump control statement, every seven passes, square root, judging whether it is a prime number, guessing number games
- Control statement + exception handling perfect lucky draw applet-java basics
- 9. Java Array Knowledge Encyclopedia
- Lucky draw applet-java basics
- Java basic implementation calculator applet
- The front end of actual combat: copy write millet's official website on the first day
- 1. Linux application programming and network programming---file IO notes in Linux system
- 7. Linux application programming and network programming --- thread full solution Notes
- [Front-end notes - CSS] 10. Cascading and inheritance + selector
- 8. Linux application programming and network programming---Linux network programming notes
- [Java|golang] 1828. Count the number of points in a circle
- Add environment variables under Linux system and will not overwrite the previous method of adding environment variables
- 2 · Linux application programming and network programming - file attributes notes
- Redis interview questions (classic 7 questions)
- [Front-end notes——CSS] 11. Box model + background and border
- C + + large Numbers together, according to a combined
- 3. Linux application programming and network programming --- get system information notes
- The use and principle of Kafka message queue
- 5. Linux application programming and network programming---signal notes in Linux
- 6 · Linux application programming and system programming - senior IO notes
- Java collection common interview questions (4)
- 072-JAVA project training: Imitation QQ instant messaging software series lecture 7 (explaining the realization of the chat interface and functions)
- Coordination center performance comparison: how zookeeper solves the load balancing problem
- 070-JAVA project training: imitation QQ instant messaging software series lecture five (explain user registration function)
- Ubuntu installation and configuration (brief)
- 073-JAVA project training: imitation QQ instant messaging software series lecture eight (explain query and add friend function)
- SQL injection classification and error injection EXP
- All basic commands in linux fail, showing that the command cannot be found
- 4. Linux application programming and network programming---Linux process full solution notes (difference between process and program)