If you are new to the JavaScript, you’re probably asking yourself, how do I navigate through this foreign world? JavaScript has a very unique culture, but with time and practice, it’s surprising to find that the things that can make it so intimidating at first, are the same things that make it so fun later on: that is, once you’ve learned it. It is interesting to know that for the the seventh year in a row, JavaScript has been ranked the most commonly used programming language, with 67.8% of developers employing it in 2019. Its ascent to the world’s most popular programming language is synonymous with the rise of the internet itself.
Created out of necessity, it is used to build 95.2% (1.52 billion) of websites today, including some of the world’s largest, like Facebook and YouTube. Without it, we would not have popular and useful web apps such as Google Maps and eBay. ~Reference~ https://www.springboard.com/blog/history-of-javascript/
Right off the bat, when working with this framework, we can pick up on how it’s quite different from other languages. Let’ take for example, Functions(which are similar to methods in Ruby), inside the function body, we can reference variables and functions declared in the function’s scope. However, from outside the function, we can’t reference anything declared inside of it. Another example, if you’ve made an error in your code, Java Script may only tell us the line the error occurred. Yet, in other languages, not only would they point out the line of error, but also give us a detailed description of what that error could be. Plus with this language; there are three distinct ways we can actually define a variable. Something that we will touch on later on…
First thing’s first
A great way to approach JavaScript is to first touch on the over arching concepts. To help us get started, we are going to further discuss these concepts, explain a few important functions, and introduce some exciting new vocabulary words. All these things are necessary when exploring the world of JavaScript.
DOM-Document Object Model
Tree of Objects organized in parent and child relationship.
The Document Object Model (DOM) connects web pages to scripts or programming languages by representing the structure of a document — such as the HTML representing a web page — in memory.
The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree. With them, you can change the document’s structure, style, or content. ~Reference MDN Web Docs
index.html
Skeleton of our page
The index. html page is the most common name used for the default page shown on a website, if no other page is specified when a visitor requests the site. When you go to a URL and specify a specific file, that is what the server will deliver. In other words, index. html is the name used for the homepage of the website.
index.css
Adds Flesh Color and Design to the Skeleton of our Page
CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the layout of multiple web pages all at once. External stylesheets are stored in CSS files.It controls the presentation (visual design and layout) of the website pages.
index.js
The brain…It determines the behavior of our Page
The index. js is the main file that will host our code. It typically handles our app startup, routing and other functions of our application. It does require other modules to add functionality. In other words, in this file, we can grab nodes from the index.html file and create events, and even create new elements efforts to add more character to our webpage.
Comments