I’m not so good at javascript and it’s replace, so I’m wondering if you can optimize this line (etc one .replace instead of two):
$itemClicked.replace(/ä|å/g, 'a').replace(/ö/g, 'o');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This should be the best possible if you only need to replace just these 3 letters. Using 1
.replaceis possible, but it must use a function, e.g.See JavaScript: Efficiently replace all accented characters in a string? for a generalization.