UNPKG
cirsim
Version:
latest (2.1.17)
2.1.17
2.1.16
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.10
2.1.9
2.1.8
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
Cirsim Circuit Simulator
cirsim
/
src
/
polyfills
/
endsWith.js
10 lines
(8 loc)
•
302 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
if
(!
String
.
prototype
.
endsWith
) {
String
.
prototype
.
endsWith
=
function
(
search, this_len
) {
if
(this_len ===
undefined
|| this_len >
this
.
length
) { this_len =
this
.
length
; }
return
this
.
substring
(this_len - search.
length
, this_len) === search; }; }