assignment 2 is confusing
StrayLove (2)

it says here
// In this exercise, you will be given two variables, they will be called: num1 and num2
// On the next line create a variable called 'difference' and using math operators return num2 subrtracted from num1
const difference = num1 - num2;
do_math(num1, num2);
// Please write your answer in the line above.
return difference;
i am just not getting this whole excercise. tbh the video wasnt explaining that much either. im feeling awful confused

You are viewing a single comment. View All
Vandesm14 (1636)

What are you confused on? The variable "difference" is set to num1 - num2. The function "do_math()" is a single line function, which executes and returns "difference" which is num1 - num2.

Wrapping it up: do_math will return the difference of num1 and num2.

For your error, you are setting a permanent value to the variable "difference". Instead of const, use var to declare a changeable value.

Please mark this as answered if I helped your problem

StrayLove (2)

@Vandesm14 that const value was already there when i opened the lesson. so i had no idea. the whole lesson is preset like the second example i gave you. and tyvm for all your help btw.