DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Errors in coding
1. Finding errors in code
To become better at coding we must learn to find
errors in the code. There are several things to
look for in particular.
*remember that if the code is missing one small
then it will not work.
2. Semi-colon;
Always make sure a semi-colon is at the end
of a statement for example-
document.write("grade is a");
numb1=parseInt(numb1);
3. Upper case and lower case
Words used must be identical or will not work,
for example-
numb1=parseInt(NUMB3); (wont work)
numb1=parseInt(numb1); will work
4. Open and closing tags </>
You must ensure you close the html, body and
script tags for the code to work, for example</html> </body> </script>
5. Quotation marks “”
Quotation marks must be in the () brackets
when there is a word/sentence to be displayed
for examplevar marks = prompt("enter the marks of
test",""); (will work)
var marks = prompt(enter the marks of test,);
(won't work)
6. Copy the following codes into
notepad and fix to make work
<html><body><script
type="text/javascript">
var marks = prompt("enter the marks of test","");
marks=(marks);
if(marks=60)
{
document.write("grade is a")
}
else ^ (marks >=45)
{
document.write("grade is b
}