Home > Web Front-end > JS Tutorial > Method to compare whether strings are equal in javascript_javascript skills

Method to compare whether strings are equal in javascript_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:28:15
Original
1241 people have browsed it

I read a lot on the Internet, for example, ==.equals didn’t work

It was because of the help of foreign websites that I found a method.
http://stackoverflow.com/questions/2167602/optimum-way-to-compare-strings-in-javascript
Use the string_a.localeCompare(string_b) method to do it; it will return 3 values ​​of 0: String equality -1: String string_astring_b You can use the correct method to compare strings in the future.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template