D
D
Dubolom Unicellular2020-05-04 22:15:47
JavaScript
Dubolom Unicellular, 2020-05-04 22:15:47

What is the name and how to use this thing / \ in js?

What is the name of this thing: /\
How does it work? After all, for example, in webpack.config.js, the following structure is written in the test field:
/\.js$/
or, for example, in search():

var str = "Mr. Blue has a blue house"
var n = str.search(/blue/i);

What is this thing anyway?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2020-05-04
@duboloms

Regexp

J
JuniGobi, 2020-05-05
@JuniGobi

To make the dot a symbol in the search string, the script looks for the string ".js" at the end of the text.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question