I have one JS file called taxForms.js and a script syntax within the html file. And I need to make changes within the html file, so the console.log()
puts out the right output.
My task goes like this:
In income-greather-than-500k.html you will find an array of tax forms assigned to the variable called taxForms. In its current state the entire array is logged to the console. You need to change the Javascript in incomegreather-than-500k.html such that the array is iterated and only the real name of the superheroes that have an income greater than 500 000 are logged with console.log.
I have tried if statements to output the right answer, but I always get an error in the console.
javaScript:
const taxForms = [
{
realName: "Bruce Wayne",
income: 750000,
wealth: 300000
},
{
realName: "John Blake",
income: 440000,
wealth: 832000
},
{
realName: "Selina Kyle",
income: 640000,
wealth: 432000
}
];
html:
<!DOCTYPE html>
<html>
<head>
<title>Income greather than 500 000</title>
<meta charset="UTF-8">
<script src="taxForms.js"></script>
</head>
<body>
<script>
if (taxForms[income] > 500000) {
console.log(taxForms);
}
</script>
</body>
</html>