Week 3 Day 2 - February 18, 2025
Javascript and DOM
Today we continued with Javascript by looking at the Document Object Model. The document object model is the data representation of objects the comprise the structure and content of objects on the web. It can be modified with Javascript.
We reviewed how to store variables with let and const. With the let keyword, the valua of the variables can change while with the const keyword the value of the variables will stay constant. We also went over camelCase, the notation that we use for the variables that we change. The first word is all lower case and the following words start with capital letters.
We reviewed that they are two methods to write in a browser - document.write and console.log. Document.write writes directly in the browser while console.log writes in the console header.
We reviewed a little more about arrays, but I am going to have to look into that further. Strings are arrays of characters. We also learned about pipelines and "and" which are logical operators. || pipelines mean "or" and & means "and".
The index exercise involved modifying the clothing catalog with javascript rather than css. I found that I used many lines of code to make the changes and wonder if that is correct. Doing the exercise in CSS previously was extremely helpful.