This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Удалить из строки по индексам | |
let delAtIdx= (s,i) => s.slice(0,i)+s.slice(i+1) | |
//версия прототипа | |
String.prototype.delAtIdx = function (from, to) { | |
if (!to) to = from | |
to = Math.max(from,to) | |
from = Math.min(from,to) | |
return this.slice(0,from)+this.slice(to+1) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//проверка на присутствие числа в аргументе | |
//если хоть один аргумент в массиве совпадает с числом, возвращает true | |
Number.prototype.trueOf = function(...props) { | |
return props.includes(this) | |
} |
NewerOlder