/**
* @param {string}
* @return {boolean}
*/
const isPersian = (str) => {
const letters = [];
for (let i = 0; i <= str.length; i++) {
letters[i] = str.substring((i - 1), i);
if (letters[i].charCodeAt() > 255) { return true; }
}
return false;
}
const text = "Reference site about Lorem Ipsum, giving information on its origins, as well as a random Lipsum generator."
const fa = "این یک متن ازمایشی میباشد";
isPersian(text) // return false
isPersian(fa) // return true