Resolve | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
29th May 2020, 5:58 AM
Priyanshu Gupta(ą¤Ŗą„ą¤°ą¤æą¤Æą¤¾ą¤‚ą¤¶ą„ ą¤—ą„ą¤Ŗą„ą¤¤ą¤¾)
Priyanshu Gupta(ą¤Ŗą„ą¤°ą¤æą¤Æą¤¾ą¤‚ą¤¶ą„ ą¤—ą„ą¤Ŗą„ą¤¤ą¤¾) - avatar
1 Resposta
0
1) it works if you put the script in the html: <html> <head><title></title></head> <body></body> <script>YOUR CODE HERE...</script> </html> 2) you have bad references in the variables, because you declare a variable into a function but you want to use in another function where the variable doesn't exists. You need to declare outside the function: You have this: function x{ var example = 1; } function y{ example = 2; } but the function Y doesn't know what is "example" So you need to declare outside the function: var example = 1; function x{ example++; } function y{ example++; }
30th May 2020, 10:15 AM
Luis E. GĆ³mez Mena
Luis E. GĆ³mez Mena - avatar