I am starting over again in JavaScript because I realized and found out I didn't take my time and practice the basic concepts and fundamentals like I thought I was doing, and I see now that is important to practice the basic concepts and fundamentals and slow down.
Today, I was practicing the basic concepts of JavaScript. I ran into an issue and solved it, and learned something new.
I wanted to share what I learned.
Today as I was practicing type casting/type conversion and trying to convert a string to a number, I wrote age = Number(age); for the age variable to convert it to a number.
I also wrote gpa = Number(gpa);
I was thinking to myself that I am writing it the way the tutorial is writing the code to convert data types.
I finally figured out that it was because I placed the type conversions/type castings, age = Number(age); and gpa = Number(gpa); after the console.log.
I learned the placement of where you put your type casting/type conversion affects whether you still get the same data type back in the console or if it changes to the data type you are converting it to.
I also learned you refresh your browser after changing the position of the type conversions/casting because if you don't the browser will still give you back the same data type and not the converted data type you are trying to convert.
I didn't know these 2 things until now as I am practicing the type version/type casting concept.
I also was practicing textContent, writing sentences with template literals and curly braces, variables, data types. I also learned a lit but about Symbol data type and BigInt data type.
I learned that we use Symbol data type mainly in objects, but I think they can be used in any other data type and anywhere. Symbols are used to create unique key so no properties or id or any values don't overwrite the other and they all have their own unique id.
If you wanted to write two or more email or id even with the same description in the parenthesis, the Symbol will allow you to assign a unique key so no value or property overwrite each other and every value and property can all coexist together.
BigInt data type is used when working with large data and large number that are either beyond a certain number range in JavaScript.
BigInt also is used for data that is smaller than the number range in JavaScript.
I don't fully understand or know BigInt and Symbol, but this is what I understood from my research on these two.
I also have been practicing arithmetic operators. I learned about the operator precedence, where you solve equations based on a certain order, like Parenthesis, then exponents, then multiplication& division &modulous operator, and you solve the equation in that order.
I learned the 2 ways to accept user input which was either through a window prompt or creating an html box.
I was practicing the modulous operator and to me the modulous operator is so cool and fascinating.
I also learned how textContent works. textContent works where you can set and get data. I practiced these two and changing the text using text content.
It was fun changing the text of the heading when clicking the button and also doing that with paragraphs and I did these exercises one at at a time, not changing the text all at the same time, but it was fun and fascinating.
It is fascinating to see how JavaScript and textContent works and how everything come together on the screen.
TextContent and Modulous was the most fascinating concepts, even though all of them are fascinating to me.
It was fascinating to also see how textContent makes things display on the screen without hard coding it into the html file.