Please Help Detect The Error In The Code - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Please Help Detect The Error In The Code (611 Views)
| Please Help Detect The Error In The Code by johnhood(op): 12:20am On Nov 17, 2020 |
Please I'm a novice in programming. My main aim of the JavaScript snippet below is I want to declare a global function and use the value for my second function but when I ran the code it did not work. Please I appreciate if someone can point out the error for me. function fun1() {var n=6.7569; var ns=n.toFixed(2 );} function fun2() {var t=prompt.window("what is your number?" ); var ps=document.getElementById("ut2" ).innerHTML=t*fun1()}; } |
| Re: Please Help Detect The Error In The Code by cixak95211: 12:30am On Nov 17, 2020 |
Where did you dig out the tutorial you're following? "var" in 2020? Besides, you didn't even paste the error message you're receiving . . and also do well, to send a screenshot of the entire code block invoking the functions |
| Re: Please Help Detect The Error In The Code by Nobody: 1:25am On Nov 17, 2020 |
cixak95211:The irony is that let still converts to var , when you check the ES5 code |
| Re: Please Help Detect The Error In The Code by cixak95211: 1:36am On Nov 17, 2020 |
pcguru1:True, not just "let", all ES6+ keywords/expressions will be transpiled , but at least to keep your sanity intact, you'd want to keep up with ECMA ![]() |
| Re: Please Help Detect The Error In The Code by johnhood(op): 5:02am On Nov 17, 2020 |
cixak95211:I am confused. "var" is for variable. |
| Re: Please Help Detect The Error In The Code by johnhood(op): 5:05am On Nov 17, 2020 |
cixak95211: |
| Re: Please Help Detect The Error In The Code by etoluw: 7:10am On Nov 17, 2020 |
johnhood:2errors 1. it is window.prompt not prompt.windoww 2, you have to add return ns in fun1 |
| Re: Please Help Detect The Error In The Code by Jas80: 12:01pm On Nov 17, 2020 |
cixak95211:oga, he said he is a beginner, how is he going to know the difference between bar and let if he doesn't try them out? |
| Re: Please Help Detect The Error In The Code by Lamexx(m): 2:22pm On Nov 17, 2020 |
johnhood:As a beginner, if you are learning how to code, you should be posting queries or question to `stackoverflow`. That is the platform for developers (experienced and novice). |
| Re: Please Help Detect The Error In The Code by johnhood(op): 6:44pm On Nov 17, 2020 |
etoluw:Thanks. Let me try it out. |
Help Me With The Code • Encountering This Error In Django: TypeError: 'module' Object Is Not Iterable • What Was Used To Compile The Code That Was Used In Creating A Compiler? • 2 • 3 • 4
What Should I Start From Between XHTML And HTML5 • Please Who Has A This Script • Get The Best Bitcoin Investment Website, Brokers Website, Trading Website