Basic calculator using prompt method in JavaScript | Part 23 | JavaScript | #SmartCode

preview_player
Показать описание
#JavaScript #learnJavaScript
JavaScript From Basic To Advanced!
Part 23:
So finally, efter learning so many things on JS, in this tutorial we are tyring to put things togheter. We will develop a basic calculator using prompt method. Prompt method is used to read data in the program. In a real application, you will learn how to read data and perform conversion as well as validation.

Please put comments and do give me your feedback.

Split string in several lines | String data type in JavaScript | Part 22 , includes following topics:

- Development of basic calculator using prompt method.

Thanks for watching.
#SmartCode
Рекомендации по теме
Комментарии
Автор

Thank you for this #SmartCode. It has been helpful.

princeosiohwo
Автор

Hi Salar, thank you so much for sharing your knowledge with us <3

ridafatima
Автор

Hi Salar, at first for const num2 I had typed parstFloat instead of parseFloat so I got my alert to work. -ha! Then I ran the program and my JS warning says, “Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.”
Not sure what that means… thanks for your tutorial… 💗… Cheers!
Edit: so I think I figured it out. At first, I put my JS link at the head tag with ‘defer’ but the console didn’t like that. So I moved my script tag to the bottom of my index page just before the closing body tag, now I can see my calculator working in the open browser window. But the console is still complaining: it says
“[Violation] Avoid using document.write( ).” I’m checking it out a bit later today, I’ll let you know what I find out, thanks!

hiwayshoes
Автор

Kindly make scientific calculator using prompt

hamdaaziz
Автор

hi sir, thank you for this work
But I have an observation, Why is the code not working when I link from an external script, but then works when I enter the a script at the bottom of the hmtl page?

Ovoworks
Автор

How can you loop this without to refresh the page all the time?

saraalobaidli
join shbcf.ru