JSFiddle - React, Tailwind, and code Playground

by SamokhinDmitro_33JS

JavaScript

function User(name){
                        this.name = name;
            }
            
          User.prototype.sleepDuration = 8;
            User.prototype.present = function(){  
                        console.log("My name is " + this.name);
                        console.log("I am a student of the " + this.university);
            }
            User.prototype.sleepAtHome = function(){
                        console.log("I will sleep " + this.sleepDuration + " hours");
            }
            
            
            function Student(name, university){
                        this.name = name;
                        this.university = university;
                        
            }
            Student.prototype.sleepInClass = function(){
                        console.log("I will sleep 3 hours in the class");
                       
            }

console.log(User.prototype);
console.log(Student.prototype);
//User('ccc');
//Student(name, university)
Student('nam', 'universit');