script src cdnjs cloudflare com ajax libs highlight js 10 1 1 highlight min js script link rel stylesheet href cdnjs cloudflare com ajax libs highlight js 10 1 1 styles default min css script let js program to convert celsius to fahrenheit ask the celsius value to the user const celsius prompt Enter a celsius value calculate fahrenheit const fahrenheit celsius 1 8 32 display the result console log celsius degree celsius is equal to fahrenheit degree fahrenheit abc abc script div id code style font family arial border 1px dashed gray white space pre div script let code document getElementById code js js replaceAll lt js js replaceAll gt let word prompt let dd select id cars correct prompt onchange update this option value option option value prompt prompt option option value get get option option value read read option option value enter enter option select const startIndex js indexOf word if startIndex 1 const endIndex startIndex word length 1 if startIndex 1 endIndex 1 js js substring 0 startIndex dd js substring endIndex 1 code innerHTML js trim function update sel console log update sel console log sel getAttribute correct console log sel value if sel value sel getAttribute correct sel style backgroundColor green else sel style backgroundColor script script let js program to convert celsius to fahrenheit ask the celsius value to the user const celsius prompt Enter a celsius value calculate fahrenheit const fahrenheit celsius 1 8 32 display the result console log celsius degree celsius is equal to fahrenheit degree fahrenheit abc abc script div id code style font family arial border 1px dashed gray white space pre div script let code document getElementById code js js replaceAll lt js js replaceAll gt validWords js matchAll n r a zA Z n r g validWords validWords validWords forEach w i validWords i w 1 trim validWords validWords filter w return w length 1 console log validWords validWords function getAllIndexes arr val var indexes i 1 while i arr indexOf val i 1 1 indexes push i return indexes let word prompt let word validWords Math floor validWords length 1 Math random console log Random word word let dd select id cars correct word onchange update this option value option option value word word option option value get get option option value read read option option value enter enter option select function regexIndexOf text re i var indexInSuffix text slice i search re return indexInSuffix 0 indexInSuffix indexInSuffix i var re new RegExp n r word n r g const startIndex regexIndexOf js re 0 1 js indexOf word if startIndex 1 const endIndex startIndex word length 1 if startIndex 1 endIndex 1 js js substring 0 startIndex dd js substring endIndex 1 code innerHTML js trim function update sel console log update sel console log sel getAttribute correct console log sel value if sel value sel getAttribute correct sel style backgroundColor green else sel style backgroundColor script script src cdnjs cloudflare com ajax libs highlight js 10 1 1 highlight min js script link rel stylesheet href cdnjs cloudflare com ajax libs highlight js 10 1 1 styles default min css script let js program to convert celsius to fahrenheit ask the celsius value to the user const celsius prompt Enter a celsius value calculate fahrenheit const fahrenheit celsius 1 8 32 display the result console log celsius degree celsius is equal to fahrenheit degree fahrenheit abc abc script div id code style font family arial border 1px dashed gray white space pre div script let code document getElementById code js js replaceAll lt js js replaceAll gt html hljs highlightAuto js value console log html html js html validWords js matchAll n r a zA Z n r g validWords validWords validWords forEach w i validWords i w 1 trim validWords validWords filter w return w length 1 console log validWords validWords function getAllIndexes arr val var indexes i 1 while i arr indexOf val i 1 1 indexes push i return indexes validWords sort Math random 5 1 1 let no 3 let selWords for let n 0 n no n selWords push validWords n for let n 0 n selWords length n let word prompt let word validWords Math floor validWords length 1 Math random let word selWords n console log Random word word let rw get read enter flat sing help rw sort Math random 5 1 1 let dd select correct word onchange update this dd option value option dd option value rw 0 rw 0 option dd option value word word option dd option value rw 1 rw 1 option dd option value rw 2 rw 2 option dd select function regexIndexOf text re i var indexInSuffix text slice i search re return indexInSuffix 0 indexInSuffix indexInSuffix i var re new RegExp n r word n r g const startIndex regexIndexOf js re 0 1 js indexOf word if startIndex 1 const endIndex startIndex word length 1 if startIndex 1 endIndex 1 js js substring 0 startIndex dd js substring endIndex 1 code innerHTML js trim function update sel console log update sel console log sel getAttribute correct console log sel value if sel value sel getAttribute correct sel style backgroundColor green else sel style backgroundColor script script src cdnjs cloudflare com ajax libs highlight js 10 1 1 highlight min js script link rel stylesheet href cdnjs cloudflare com ajax libs highlight js 10 1 1 styles default min css script let js program to convert celsius to fahrenheit ask the celsius value to the user const celsius prompt Enter a celsius value calculate fahrenheit const fahrenheit celsius 1 8 32 display the result console log celsius degree celsius is equal to fahrenheit degree fahrenheit abc abc script div id code style font family arial border 1px dashed gray white space pre div script let code document getElementById code js js replaceAll lt js js replaceAll gt html hljs highlightAuto js value console log html html js html validWords js matchAll n r a zA Z n r g validWords validWords validWords forEach w i validWords i w 1 trim validWords validWords filter w return w length 1 console log validWords validWords function getAllIndexes arr val var indexes i 1 while i arr indexOf val i 1 1 indexes push i return indexes validWords sort Math random 5 1 1 let no 3 let selWords for let n 0 n no n selWords push validWords n for let n 0 n selWords length n let word prompt let word validWords Math floor validWords length 1 Math random let word selWords n console log Random word word let rw get read enter flat sing help rw sort Math random 5 1 1 let dd select correct word onchange update this dd option value option dd option value rw 0 rw 0 option dd option value word word option dd option value rw 1 rw 1 option dd option value rw 2 rw 2 option dd select function regexIndexOf text re i var indexInSuffix text slice i search re return indexInSuffix 0 indexInSuffix indexInSuffix i var re new RegExp n r word n r g const startIndex regexIndexOf js re 0 1 js indexOf word if startIndex 1 const endIndex startIndex word length 1 if startIndex 1 endIndex 1 js js substring 0 startIndex dd js substring endIndex 1 code innerHTML js trim function update sel console log update sel console log sel getAttribute correct console log sel value if sel value sel getAttribute correct sel style backgroundColor green else sel style backgroundColor script
i validWords i w 1 trim validWords validWords filter w return w length 1 console log validWords validWords function getAllIndexes arr val var indexes i 1 while i arr indexOf val i 1 1 indexes push i return indexes validWords sort Math random 5 1 1 let no 3 let selWords for let n 0 n no n selWords push validWords n for let n 0 n selWords length n let word prompt let word validWords Math floor validWords length 1 Math random let word selWords n console log Random word word let rw get read enter flat sing help rw sort Math random 5 1 1 let dd select correct word onchange update this dd option value option dd option value rw 0 rw 0 option dd option value word word option dd option value rw 1 rw 1 option dd option value rw 2 rw 2 option dd select function regexIndexOf text re i var indexInSuffix text slice i search re return indexInSuffix 0 indexInSuffix indexInSuffix i var re new RegExp n r word n r g const startIndex regexIndexOf js re 0 1 js indexOf word if startIndex 1 const endIndex startIndex word length 1 if startIndex 1 endIndex 1 js js substring 0 startIndex dd js substring endIndex 1 code innerHTML js trim function update sel console log update sel console log sel getAttribute correct console log sel value if sel value sel getAttribute correct sel style backgroundColor green else sel style backgroundColor script script src cdnjs cloudflare com ajax libs highlight js 10 1 1 highlight min js script link rel stylesheet href cdnjs cloudflare com ajax libs highlight js 10 1 1 styles default min css script let js program to convert celsius to fahrenheit ask the celsius value to the user const celsius prompt Enter a celsius value calculate fahrenheit const fahrenheit celsius 1 8 32 display the result console log celsius degree celsius is equal to fahrenheit degree fahrenheit abc abc script div id code style font family arial border 1px dashed gray white space pre div script let code document getElementById code js js replaceAll lt js js replaceAll gt html hljs highlightAuto js value console log html html js html validWords js matchAll n r a zA Z n r g validWords validWords validWords forEach w i validWords i w 1 trim validWords validWords filter w return w length 1 console log validWords validWords function getAllIndexes arr val var indexes i 1 while i arr indexOf val i 1 1 indexes push i return indexes validWords sort Math random 5 1 1 let no 3 let selWords for let n 0 n no n selWords push validWords n for let n 0 n selWords length n let word prompt let word validWords Math floor validWords length 1 Math random let word selWords n console log Random word word let rw get read enter flat sing help rw sort Math random 5 1 1 let dd select correct word onchange update this dd option value option dd option value rw 0 rw 0 option dd option value word word option dd option value rw 1 rw 1 option dd option value rw 2 rw 2 option dd select function regexIndexOf text re i var indexInSuffix text slice i search re return indexInSuffix 0 indexInSuffix indexInSuffix i var re new RegExp n r word n r g const startIndex regexIndexOf js re 0 1 js indexOf word if startIndex 1 const endIndex startIndex word length 1 if startIndex 1 endIndex 1 js js substring 0 startIndex dd js substring endIndex 1 code innerHTML js trim function update sel console log update sel console log sel getAttribute correct console log sel value if sel value sel getAttribute correct sel style backgroundColor green else sel style backgroundColor script