Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main(){
- const wordString = document.querySelector("#testWord").value;
- document.querySelector("#wordResult").value = wordCheck(wordString);
- }();
- function wordCheck(inputString) {
- //check asterisk
- temp = "";
- if (inputString.indexOf("*") != -1) {
- temp = inputString.replace("*", "");
- }
- //check '@'
- else if (word.indexOf("@") != -1) {
- word = `*${word}*`;
- temp = word;
- }
- //C '₪'
- else if (word.indexOf("₪") != -1) {
- temp = word.replace("₪", "new shekel");
- }
- return temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement