Skip to main content

JavaScript Objects Front end Development Course - [S4 V9 - Phase 3]



In this lesson we will understand what is a JavaScript object, how its created and used in an example project.



PROJECT FILES

https://drive.google.com/open?id=16P7bMZ43Nr64zj0U_7obeCE0uCo-y1eE



We are using an example project which is a resume website that includes portfolio. This portfolio does not contain any images, title or description INSIDE the HTML. Rather it is in a separate data file. What we have to do it fetch data from this file based on what portfolio DIV is clicked. The information of that portfolio will be displayed in a modal.



This modal is created only once and displays the data according to the clicks. We will create different objects in our reference file where each object will represent one set of actions (or properties). For example, we will reference the complete modal and its buttons, links, icons, image inside an object and use it smartly to write our logic. If we will not follow this approach, we will fall into writing too much codes with too little impact.



So what is object? Object is a key value pair, where keys have a user-defined name that can be called easily to access the value. The object is created in a way similar to a variable, and defined in a  way similar to an array (with slightly different brackets and commas).

Comments

Popular posts from this blog

Design Organized Website Structures

When developing a website, you must proactively decide its structure before starting the coding. But what does the Web Structure mean at the very first place? Website Structure can be defined as follows: When you talk about the structure of a website, you are talking about its components , their working , their location , their inter-dependency , and their interaction with the user. The design of the Website Structure does not include code. Generally, the design includes, wire frames, sketches, mock ups, lists, flow charts and other visual aids. What is a component? Well, it can be defined as follows: Components are the useful or functional parts of a website Every component has a particular purpose and function. For example, navigation bar of a website has a purpose of providing navigation links to the user. But some, components are versatile and have multiple purposes. For example, a header of website can contain a navigation bar, a search bar, a login form...

Web Development includes Websites, Web Apps and Mobile Apps

A few years back, 'Web Development' term was used for the process of developing a website. This was when web development just started to gain popularity. However, with the growing need of having browser based experience within the applications, developers started a new venture called web applications. The reason for its popularity was quick development, increased manipulation of media and content, and of course the aesthetics. Despite of its popularity, security remained its main concern for the data-critical organizations. After a while, developers managed to flawlessly handle the security concerns of the organizations. During this time span, Web Development semantically comprised of both website and web application development. During the past few years, into this group joined another term called Mobile Apps. Just recently before this addition, native apps was widely looked for, but now organizations have realized that the power of a native app is achievable in lesser cos...

Learning JavaScript for Web Designing

There was a time when JavaScript was only used for handling events on the webpage. Front-end developers were more interested in learning tables and CSS for designing the layout of the websites. Today, the trend of designing and developing website is a lot more complicated, quick and advanced. Website is no more a static representation of media and content; it is more of a platform where users are interacting with the content, exploring the information, analyzing their businesses; this turns even a simple website into a web application. Achieving this level of engagement and functionality requires not only the skills of  HTML and CSS but also JavaScript. Now, the Jacks of this trade knows that we are not directly using JavaScript, we use frameworks and libraries to design and layout the structure of the websites. One of the most widely used frameworks is Bootstrap, which requires jQuery as its library. JQuery is a JavaScript based library that has created pre-built functions and...