first repeated character in a string javascript
function firstRepeatingCharacter(str) {
for (let i = 0; i < str.length; i++) {
if (str.indexOf(str.charAt(i)) !== str.lastIndexOf(str.charAt(i))) {
return str.charAt(i)
}
}
return 'no results found'
}
Also in JavaScript:
- readfilesync
- route react
- json enconde
- replace all occurrences of a string in javascript
- alpinejs examples stackoverflow
- emit cheatsheet
- $(getJson) returning error
- what is JSON TREE
- js increment safety value html
- set headers in express
- $(this).text() in jquery return white space
- jquery select input value empty and hasclass
- scrollbar position
- AJAX in reload a div container
- javascript number in alphabet
- firebase auth sign out javascript
- js indexof regex
- ajax response length
- javascript call() & apply() vs bind()?
- javascript date is an object
- reactjs and webpack tutorial
- switch two values each case js
- input type shows object angularjs
- how to register key presses in p5.js