This lesson was great to build upon the previous lesson where we learned to write html code and create styles with css. Leading up to the assignment, each section was informative and helped me better comprehend the role of javascript and how it is used within the html document. I did enjoy the w3schools tutorials, which were effective at simplifying the explanations for the various aspects of javascript.
Through the w3schools tutorial and the lesson materials which walked through the Maps SDK, there were to concepts that did confuse me slightly. First was the use of “new” when declaring a variable (using var or let) and a constant (with const). Within the w3schools walkthrough, I don’t think it was really explained when you used “new” and when you did not. After watching the video from Prof Detweiler, I think I do have a better understanding – “new” is used when basing a variable (or constant) off of a defined data type or object.
The other concepts that did confuse me, but again were cleared up through the video, were the anonymous functions and asynchronous callback functions. It was difficult to grasp the concept after just reading about them, but the explanation in the video, accompanied by the visual of pointing to the referenced part of the code, helped tremendously.
Finally, one point for clarification is the use of "var" versus "let." From the w3schools, it appears that using "let" is encouraged and "var" should only be used if required to support older browsers. I understand the reason to use "let" over "var" (let is block scope where var is global), but in the video discussion, it was mentioned to use "var." Is there a standard for the class or is the standard to follow best practices (which is "const" and then "let" when a variable may change)?
Matthew Pawlenko
GEOG-863
mzp5867@psu.edu
27 Jan 2024