Tag:statement

  • JS function

    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 […]

  • Using built-in objects Math.random Realize Guessing Number Game

    Time:2021-3-2

    function getRandom(min,max){ return Math.floor ( Math.random () * (max min + 1)) + min; / / get the random integer between two numbers, including the two values penetrated by the real parameter. } var random = getRandom(1,10);   For (VaR I = 1; I < = 10; I + +) {/ / for loop traversal, declaring […]

  • JS function encapsulation to achieve a countdown effect

    Time:2021-2-27

    1: The core algorithm is the input event – the remaining time, which is the countdown Total number of milliseconds entered – the total number of milliseconds of the current time. The remaining number of milliseconds is the countdown time 2: Turn the remaining milliseconds into days, hours, minutes and seconds   function getTime(time){ Var […]

  • Hands on how to configure Vue’s eslint

    Time:2021-2-26

    1. Install eslint npm install –save-dev eslint 2. New.eslintrc.jsFile configuration eslint If you install it globally, eslint can also be usedeslint –initTo configure files automatically The default configuration is as follows: (eslint — init automatically generated) module.exports = { “extends”: “eslint:recommended”, “parserOptions”: { “ecmaVersion”: 5, “sourceType”: “module” }, “rules”: { } }; Let’s test itConfigure […]

  • Native JS judge scope output value

    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 […]

  • Go – array

    Time:2021-2-19

    summary An array is a sequence of elements of a specific type with a fixed length. An array can be composed of zero or more elements. Once declared, the length of the array is fixed and cannot be changed dynamically. Len() and cap() always return the same result.Declaration array   package main import ( “fmt” […]

  • Dependence and version of NPM

    Time:2021-2-19

    Dependence and version of NPM In our daily development, we use centralizedpackage.jsonThe configuration file is used to maintain the configuration information (such as name, version, license and other metadata) of the project and the dependent modules Dependency type At present, it supports the following five types dependencies devDependencies peerDependencies optionalDependencies bundledDependencies/bundleDependencies Examples { “name”: “quanerp-pc-v4”, […]

  • 1. Variables: VaR, let, const

    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. […]

  • CSS inline style

    Time:2021-2-16

    In this section, we want to learn several forms of CSS style. There are three ways to introduce CSS style into HTML in practical application, namely, in line style, internal style and external style. We will learn the advantages, disadvantages and application scenarios of these three methods in turn. In this section, we will talk […]

  • The first line of kotlin series (3) use of intent to return data onactivityresult to the previous page

    Time:2021-2-14

    one MainActivity.kt Jump processing Declare the global button object private lateinit var button8: Button Instantiate button object button8 = findViewById(R.id.mButton8) button8.setOnClickListener(this) Click jump of add button R.id.mButton8 -> { val intent = Intent(this, ReturnData().javaClass) startActivityForResult(intent, 1) } Note: the use of startactivityforresult here is the same as that of Java. It can also transfer the […]

  • Go – variable declaration

    Time:2021-2-13

    summary Before declaring variables, let’s first understand the data types of variables. This article mainly deals with string, Boolean and number, and other types will be discussed later.data typecharacter string string   It can only be defined with a pair of double quotation marks (“) or back quotation marks (‘). It cannot be defined with […]

  • Study day 46

    Time:2021-2-10

    C++ 1. Constructor 1. For a special member in a class, its name is the same as the class name. When creating a class object, the special member will be automatically called by the system 2. Forget to call manually 3. The purpose is to initialize the data members of class objects 4. The constructor […]