INM 320 / INCLASS ASSIGNMENT

In this example below you will see how to do a INM 320 / INCLASS ASSIGNMENT with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by _jajaja-kelly, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright _jajaja-kelly ©
  • HTML
  • CSS
  • JavaScript
    <h1>Human</h1>


/*Downloaded from https://www.codeseek.co/_jajaja-kelly/inm-320-inclass-assignment-VQYgWO */
    


/*Downloaded from https://www.codeseek.co/_jajaja-kelly/inm-320-inclass-assignment-VQYgWO */
    let Human = function(){
  this.exists = true;
};
let NoneHuman = function(){
  this.exists = fault;
};
Human.prototype.setCountry = function(country){
  this.country = country;
};

Human.prototype.setAge = function(age){
  this.age = age;
};

let Kelly = new Human();
Kelly.setCountry("China");
Kelly.setAge("20");
console.log(`Kellys constructor is ${Human.prototype.constructor}`);
console.log(`Kelly is coming from ${Kelly.country}`);
console.log(`Kelly is ${Kelly.age} years old`);


let OtherHuman = function(){
  Human.call(this);
  this.isOther = true;
}

OtherHuman.prototype = Object.create(Human.prototype);
OtherHuman.prototype.speakHumanLanguage = function(){
  console.log("How are you!!");
}
OtherHuman.prototype.constructor = OtherHuman;

let Josi = new OtherHuman();
Josi.setCountry("Brazil");
Josi.setAge("20");
console.log(`Josi is a human? ${Josi.exists}`);
console.log(`Josi is coming from ${Josi.country}`);
console.log(`Josi is ${Josi.age} years old`);
Josi.speakHumanLanguage();



NoneHuman.prototype = Object.create(Human.prototype);
NoneHuman.prototype.displaceNoneHumanLanguage= function(){
  console.log("Meow Meow");
}
NoneHuman.prototype.constructor = NoneHuman;

let Cat = new NoneHuman();
console.log(`Cat is a human? ${Cat.exists}`);
Cat.setCountry("Live with Kelly")



Comments