Tag:literal

  • Eslint code specification for vue-cli3 project configuration

    Time:2021-7-23

    preface Recently took over a project, because before in order to rapid development, did not do code checking. In order to make the code more standard and easier to read, it’s time for eslint. Installation dependency There are two ways to install dependencies: Add the corresponding dependency to devdependences in CMD, and then NPM install […]

  • Objective-C Tips

    Time:2021-6-12

    Notes & suggested usage Bool is actually an 8-bit character type. If an integer value greater than 1 byte is assigned to bool, only the status character will be used as the bool value. In the header file, other header files should be introduced as little as possible, and [email protected], or use the class protocol. […]

  • Four patterns of creating instance objects in JS

    Time:2021-5-12

    demand Complete the following functions: Returns an object The value of the greeting attribute of the object is equal to STR1, and the value of the name attribute is equal to STR2 Object has a sayit method, the string returned by this method is the value of greeting attribute + ‘,’ + name attribute analysis […]

  • ES6 (IX) – string

    Time:2021-3-18

    catalog Template String literals String wrap Contains variables or expressions Tag literals Logical operation Extension method of string Es6-es10 learning map Template String literals It is used to solve the problem of string splicing. Starting from ES6, you can define strings in this way. `string text` `string text line 1 string text line 2` `string […]

  • Using new object to create objects

    Time:2021-3-11

    Var obj = new object(); / / an empty object is createdobj.uname = ‘zhangsanfeng’;obj.name =18; / / the literal way to create an object is different. Here you need to use = assignment to add properties and methodsobj.sex =’Nan’; / / attributes and methods end withobj.sayHi = function() { console.log(‘hi’);} console.log(obj.uname);  console.log(obj[‘age’]);

  • Why is Python built-in functions not universal?

    Time:2020-12-2

    This article is from the “why Python” series, please check outAll articles stayPython catOfLast articleIn this paper, we compare two methods of creating lists, literal usage [] and built-in type usage list (), and then analyze their differences in running speed. When analyzing why list() is slower, it is said that it needs to go […]

  • Grep of three swordsmen in shell text processing

    Time:2020-11-30

    Filter, mainly used to filter file content and find matching information. Grammar: grep [option] [pattern] [file1,file2…] command | grep [option] [pattern] <!– more –> Parameter (option) -vDo not display matching information -iIgnore case when searching -nset number -rRecursive search (all directories under current directory) -ESupports extended regular expressions, equivalent toegrepcommand -FDo not match by regular […]

  • JS data type conversion and literal

    Time:2020-11-10

    JS data type conversion and literal 1. Convert to string mode explain example toString() Convert to string var num=1;alert(num.toString()) String() cast Convert to string var num=1;alert(String(num)) Plus concatenated string And string concatenation results in strings Var num=1; alert (num+’I am a string’) Note: a third conversion method is recommended, also known asImplicit transformation。 2. Convert […]

  • What are the three dots (…) in JS?

    Time:2020-9-19

    When we look at JS code, we often have (…) three dots. What does it mean? What’s the use?Now I’d like to share with you three things what do you mean? The three dot (…) is called extension operator, which is a new content in ES6. It can expand array expression or string in syntax […]

  • On the efficiency of JS regular literal / / and new regexp

    Time:2020-9-5

    A few days ago, we talked about the problem of regular matching JS string: “matching string of JS regular learning notes” and “matching string optimization of JS regular learning notes”.It is said that optimizing regularization can improve performance, but how much can it be improved?So I went to the test and found that TMD was […]

  • Matching string literals in JS regular learning notes

    Time:2020-9-2

    Today, I have read some examples in Chapter 5. I have gained a little. I have recorded them as a review and as a share. There are many types of string matching. Today we will discuss string matching in JS code. (because I want to write a grammar highlight after learning, so I use js […]

  • Notes on understanding ES6 — strings and regular expressions (2)

    Time:2020-8-21

    Compared with the declaration of variables in Chapter 1, the content of this chapter is a little deeper, but it is not difficult to understand. This chapter mainly talks about two knowledge points,character string、regular expression character string String is the big raw data type of JavaScript 6. The others are Boolean, null, undefined, number and […]