let myName = 'yourname'; let randomChar = Math.trunc(Math.random() * myName.length); console.log(myName.charAt(randomChar));