Simple function to Encryption on Mobile No,email id or any user information in react-native

Hii, EveryOne , today i am going to write a simple java script function , in which we change the format of number, suppose you get a mobile number form back-end or from the user and now you want to encrypt that number , mobile no is - 9876543210 and you have to show the number in the following format mobile no is - 98XXXXXX10 , if you are beginner in mobile application development you see this kind of situation, so here is the function with the help of the this function you can handle the situation like this, you can convert e-mail, mobile no, card no, name and any user information , const changeTheNumber=(number)=>{ var newNum = number.toString() var res = ''; for(var i = 0; i<newNum.length; i++){ if (i > 1 && i < 8){ res = res + newNum[i].replace(newNum[i],'X') //console.log(res) }else { res = res + newNum[i] } } //console.log(newNum) //co...