Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,200,096 members, 7,973,695 topics. Date: Sunday, 13 October 2024 at 12:20 AM |
Nairaland Forum / Science/Technology / Programming / Please Help Detect The Error In The Code (499 Views)
Help Me With The Code / What Was Used To Compile The Code That Was Used In Creating A Compiler? / I’m One With The Code, The Code Is With Me. (2) (3) (4)
Please Help Detect The Error In The Code by johnhood(m): 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 2 Likes |
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 1 Like |
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(m): 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(m): 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 4 Likes |
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? 3 Likes |
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(m): 6:44pm On Nov 17, 2020 |
etoluw:Thanks. Let me try it out. |
(1) (Reply)
My Resolve / E-commerce Web Developer Needed Urgently. / How Can A Programmer Earn Enough Money As A Freelancer?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17 |