📅  最后修改于: 2022-03-11 15:02:21.531000             🧑  作者: Mango
//function to return last character in word
function lastChar(number){
const str = number
console.log(str.charAt(str.length-1));
}
lastChar('sun'); //n