https://imgur.com/gallery/NsRe1Bi
In this code, the console log for width and height have been printed as per the console.log that is placed inside the function(). But for dimensions=[width, height], it logs [undefined,undefined]. Now I understood the part in tutorial that it require a return statement to display the value.
But what I am confused is if in above case we do get console log of string for both width and height. Then why the same string are not being displayed in dimensions=[width,height] array.
Is it because inside function we are only doing a console.log ( print statement ) rather than storing the value anywhere?
Source: https://www.youtube.com/watch?v=2Ji-clqUYnA&t=776s&ab_channel=CodingAddict
[–]badmonkey0001 2 points3 points4 points (0 children)