Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of scriptify

scriptify

scriptify has asked 0 questions and find answers to 2 problems.

Stats

28
EtPoint
5
Vote count
0
questions
2
answers

About

I am a full time JSholic. This is not limited to coding but also to news. I'm interested in everythin gwhich has to do with javascript. Of course I am generally interested into the theoretical thing js bases on: Computer Science (the base class of my addiction).

Surprisingly, I am also interested in other thing, but I don't think that those a relevant for mentioning here on stackoverflow.

class Addiction {
    addictionLevel = Number.MAX_VALUE;

    constructor() {}

    lower() {
        this.addictionLevel--;
    }

    higher() {
        this.addictionLevel = Number.MAX_VALUE;
    }
}


const myAddiction = new MyAddiction();
const me = new AverageHuman(myAddiction);

const life = window.setInterval(() =>{
    if(me.isDoingSomethingRelatedToProgramming)
        myAddiction.lower();
    else
        myAddiction.higher();
}, 0);