Giter Site home page Giter Site logo

lab-javascript-oops-blog's Introduction

Image description

ProGrad Lab | JS BLOG

We have learned Object-oriented programming and how class and inheritance work in JavaScript. Now lets work with our Viking friends, applying all of the concepts we have just learned.

What should you do

Fork this repo
Clone this repo
Practice OOPs Features

How To Submit

Upon completion, run the following commands:

git add .
git commit -m "ProGrad ID"
git push origin master

And finally, create a pull request so your ProGrad Mentor (PM) can review your work.

Instructions

We must write the correct code in the script.js file. In this file you will find the following starter code:

class Blog{

}

In this case, it says that Blog class should receive 2 arguments (title & detail), so we have to write the correct code. Let's make the Blog class receive two arguments:

class Blog{
constuctor(title,detail){}

}

Progression 1: WRITE UP

Modify the Blog class and add two methods to it: addTitle(), and addDescription().

class

  • should receive two arguments title and detail.
  • should receive title as first argument.
  • should receive detail as second argument.

addTitle()

  • should be a method.
  • should receive 0 arguments.
  • should display the title of Blog as H1.
     var title_card = document.createElement('h1');
        title_card.setAttribute("id","blog-title");
        console.log(title_card);
        document.getElementById('card-text').appendChild(title_card);
        title_card.innerHTML += this.title;

addDescription()

  • should be a method.
  • should have 0 arguments.
  • should display the description as a paragraph. Image description

Image description

Progression 2: SHOW EM UP

Setup EventListeners, so that we can display the entire blog for the users Image description

Happy Coding ProGrads❤️

lab-javascript-oops-blog's People

Contributors

bhuvanajothivel avatar prograd-org avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.