Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get the first recurring character 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'
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Backbone Error: Uncaught TypeError: this.set is not a function 
Javascript :: Prevent HTTP Parameter Polution in NodeJS 
Javascript :: Javascript set control state none opposite 
Javascript :: toISOString() in electron 
Javascript :: send form data to endpoint js 
Javascript :: angular file upload code anji 
Javascript :: React Futures - Server Components 
Javascript :: screen orientation and width&height 
Javascript :: Solution-4-B--solution options for reverse bits algorithm js 
Javascript :: how to receive form data in node js 
Javascript :: decode jwt token in angular 
Javascript :: break and continue in javascript 
Javascript :: promise object 
Javascript :: change your favicon in javascript 
Javascript :: javascript interview questions interviewbit 
Javascript :: event solidity 
Javascript :: emoji picker react 
Javascript :: for-in loop 
Javascript :: react 18.2 
Javascript :: nlhoman json load from file 
Javascript :: why null is an object in javascript 
Javascript :: JavaScript for loop Display a Text Five Times 
Javascript :: javascript Rethrow an Exception 
Javascript :: date methods javascript 
Javascript :: react destructuring with rename 
Javascript :: pizza form validation jquery 
Javascript :: How to get prime numbers using for loop in Js 
Javascript :: how to generate random 6 digit charecter in js for coupon 
Javascript :: phaser remove animation event 
Javascript :: js interview questions 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =