• The use of variable deconstruction assignment in JavaScript


    introduction Deconstruction assignment is a fast and convenient variable assignment method introduced in ES6, which is mainly divided into deconstruction and assignment. The destructor, that is, matches the structure, and then decomposes the structure for assignment. Deconstruction assignment of arrays use const arr = [1,3,5] const [a,b,c] = arr; console.log(a) // 1 console.log(b) // 3 […]

  • Extension of ES6 object


    1. Super keyword (1) We know,This keyword always points to the current object where the function is located. ES6 adds another similar keyword super to point to the prototype object of the current object。 const proto = { foo: ‘hello’ }; const obj = { foo: ‘world’, find() { return super.foo; // Super here refers […]

  • Detailed explanation of kotlin vocabulary | deconstruction statement


    Sometimes you want to decompose an object with multiple fields to initialize several individual variables. To achieve this, you can use kotlin’s deconstruction declaration function. Read on to learn about the use of deconstruction, the types that kotlin provides by default, how to implement deconstruction in your own classes and those you don’t control but […]

  • Seven ways of code neatness


    Readable code is maintainable In this essay, I’ll show you some ways you can improve your code. The code examples in this article all use JavaScript. But I find that all readable code must be maintainable. As a developer, my goal is to write high quality code. Every developer in the team, regardless of his […]

  • Using webpack to build vue3 development environment from scratch


    Using webpack to build vue3 development environment from scratch Create project First, you need to create an empty directory, open the command line in the directory, and execute thenpm initCommand to create a project, this process will prompt you to enter some content, after completion will automatically generate a project package.json file Configuration file of […]

  • [email protected] transfer [email protected] 1.2% reduction in construction volume


    This paper recordsGridManagerTable component [email protected] process and problems encountered includebuild, start, testAnd other related commands. Test compatibility Try [email protected] the following options to the configuration of to test the current environment [email protected] of. module.exports = { // … node: { Buffer: false, process: false } }; If there is an error, you need to update […]

  • Introduction of new features of ECMAScript 6


    brief introduction ECMAScript 6.0 (hereinafter referred to as ES6) is the next generation standard of JavaScript language, which was officially released in June 2015. Its goal is to make JavaScript language can be used to write complex large-scale applications and become an enterprise development language. Today we will talk about the new syntax features introduced […]

  • New features of C × 7.0


    Out variable You can use out to declare variables directly in a methodint.TryParse(“123”, out var result);  tuple Declaration of tuples var alphaBetaStart = (alpha: “a”, beta: “b”); Console.WriteLine($”{alphaBetaStart.alpha}{alphaBetaStart.beta}”); Deconstruction and tuple private class User {   public string Name { get; } = “Bob”;   public string Email { get; } = “[email protected]”;   public int Age { […]

  • Python deconstruction and encapsulation


    Asking questions Let’s look at the following code first x = 1 y = 2 tmp = x x = y y = tmp print(x, y) The output of the code is: 2 1 Look at the following code: x = 1 y = 2 x, y = y, x print(x, y) The output of […]

  • Comparison between ref of vue3 and ref of react


    vue In the composite API mode of vue3, the ref function is used to make any responsive variable work anywhere The use of ref import { ref } from ‘vue’ const counter = ref(0) refTakes the parameter and returns it wrapped in avalueProperty, which can then be used to access or change the value of […]

  • JavaScript advanced (6)


    Why study ES6 Every time the birth of the standard means the improvement of the language and the enhancement of the function, JavaScript itself has some unsatisfactory places The variable lifting feature increases the unpredictability of program runtime The syntax is too loose to achieve the same function, different people may write different code Let […]

  • ES6 (x) – structure (deconstruction)


    Destructure Array-Destructure Basic Usage Skip the assigned variable and can be any traversable object On the left can be object properties Rest variable Default value & when the value of deconstruction assignment is not enough Object-Destructure Basic Usage You can change the variable name Default value Rest operator nested object Es6-es10 learning map Deconstruction assignment:Using […]