Tag:scope
-
Time:2021-3-4
1. Ordinary function Grammar: Function function name (){ Statement block } 2. Functions with parameters Grammar: Function function name (parameter list){ Statement block } 3. Function with return value Grammar: Function function name (parameter list){ Statement block; Return value; } Allow a variable to accept the return value after calling the function Var variable name […]
-
Time:2021-3-4
Reprinted from the originalGo trap for loop iteration variable Capture iteration variables It’s learningGo programmingIt’s an important warning that I encountered in the project. This is a trap of the go language’s lexical scope rules. After watching it, I feel that it’s really a confusing place. So make a special record. You can see from […]
-
Time:2021-2-27
introduction I often visit GitHub. In addition to some big projects with extremely high star, I also find many interesting small projects on GitHub. Project or idea is very interesting, or there is a good technical point, read to let a person have harvest. So I’m going to put it together as a series of […]
-
Time:2021-2-26
Source of the problem:How to measure a person’s angularjs level? What are the differences between ng if and ng show / hide? The first difference is,ng-ifThe DOM node is created only when the following expression is true,ng-showIt was created at the beginning, usingdisplay:blockanddisplay:noneTo control display and not display. The second difference is,ng-ifA new scope is […]
-
Time:2021-2-22
Can there be local temporary tables with the same name in nested stored procedures, outer stored procedures and inner stored procedures of SQL Server? If so, are there any problems or restrictions? In a nested stored procedure, do you call the outer stored procedure’s temporary table or the self-defined temporary table? Is the […]
-
Time:2021-2-21
JS engine running First parsing (also known as pre parsing): variable promotion (includingFunction expression)And function promotion one ️⃣ The premise is thatScopeFunction or script2. Only promote the variable name to the top of the current scope, and do not assign or callthree ️⃣ Check for syntax errors (none if any) Second parsing: code running From […]
-
Time:2021-2-19
preface In this article, we will build our own JS interpreter through JS and write JS in JS, which sounds strange. Nevertheless, we will be more familiar with JS and learn how JS engine works! What is an interpreter? Interpreter is a language evaluator that runs at run time. It dynamically executes the source code […]
-
Time:2021-2-19
In ES6, two variable naming methods are updatedlet constIn short:let: comparative var cannot be defined repeatedly, but has scope {self closure problem}It is often reflected in if judgment and for loopconst: cannot be defined repeatedly. It will be directly defined as a constantexample function fun(){ var a=1 var a=2 } fun() Alert (a) // 2 […]
-
Time:2021-2-18
Prepare the code, which will be used in the example var app = angular.module(‘app’, []); The angular instruction is roughly defined as follows app.directive(‘directiveName’, function() { return { // config } }) Among them, the configuration object returned by return contains many parameters, which are described as follows. 1. restrict The value is a string […]
-
Time:2021-2-16
Var can be used in all versions of ECMAScript, while const and let can only be used in ES6 and later versions. The difference of VaR, let and Const var: 1) Declaration scope: in the function, use VaR to define a variable (local variable). After the function is called, the variable will be destroyed immediately. […]
-
Time:2021-2-12
angular Framework of data bidirectional binding Provides data binding, DOM instructions. Angular defines a set of rules, which must be followed in the development. This set of rules provides a set of solutions for the project. modular,assembly,Template,metadata,Data binding, instructions,service,Dependency injection,controller,filter,route Basic concepts Start / boot BootstrapFunction: Start program entrance (bootstrap method to guide anuglar reference […]
-
Time:2021-2-11
An instruction is a function that runs on a specific DOM element to extend the function of the element. A simplified version of direct is like this app.directive(‘myDirective’, myDirective); myDirective.$inject = []; function myDirective(){ return { restrict: “AE”, template: ” scope: {}, link: function(){} } } Here are some common options. option restrict(String) Indicates the […]