Tag:literal

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

  • JS advanced – create regular expression object

    Time:2020-8-14

    Create a regular expression object   There are two types: 1. Create the object through the constructor 2. Create objects by literal quantity   The role of regular expressions: matching the   //Object created— var reg = new RegExp(/\d{5}/); //Call the method to verify that the string matches var flag = reg.test (my phone number […]

  • Shell metacharacter

    Time:2020-6-24

    Metacharacter Reference and escape References: used literallyEscape: from one mode to anotherUse \ to reference a single character, strong escape the character (strong reference)Use ” to refer to a string of characters, all metacharacters are interpreted as literal (strong reference)Use “” to refer to a string of characters. Except for $,, ‘to reserve special meaning, […]

  • Why is the literal size of objects in JS cool

    Time:2020-6-18

    By Dmitri pavlutinTranslator: front-end witSource: dmitripavlutin Take a look at it and get used to it this paperGitHubhttps://github.com/qq44924588… I’ve collected more articles of high praise in the past and sorted out many of my documents and tutorial materials. Welcome to star and perfect, you can refer to the interview site review, hope we have something […]

  • More literal types and built-in type declarations

    Time:2020-6-4

    By Marius SchulzTranslator: front-end witSource: Marius Schulz Alibaba cloud has been doing activities recently, with a 20% discount. I really think it’s cost-effective. You can click on this content or link to participate:https://promotion.aliyun.com/… Tencent cloud is currently doing activities, with 100 cloud products as low as 10% discount. You can click this content or link […]

  • Enhanced writing of ES6 object literals

    Time:2020-4-21

    What is object literal Define an object called obj Const obj = new object() // create an object and assign it to obj But in actual development, we usually don’t write like this. We usually write Const obj = {} // this brace is called the object literal The brace above{ }It’s called object literals. […]

  • A summary of regular expression (JavaScript) for password strength

    Time:2020-4-19

    Brief statement In this paper, we give two regular expression schemes of cipher strength, one is simple, the other is more complex and secure. The analysis and test procedures of the two schemes are given. Generally, you can define your own password regular convention according to the actual needs of your project. Preface When users […]