Can you also tell me the difference between using
class Calc {
static sum;
static operatorMemory;
static reset() {
Calc.sum = undefined;
Calc.operatorMemory = undefined;
}
}
and using a object like this
const calc = {
sum,
operatorMemory,
reset: function reset() {
this.sum = undefined;
this.operatorMemory = undefined;
}
}
I am confused when to use which
new
one, you are using class/static methods, whereas when you create a new instance you have access to its prototype/instance methods.
I have used this function to initiate the app
class Event{
........
........
static init() {
document.addEventListener("DOMContentLoaded", function () {
Event.captureInput();
});
}
Event.init();
on my local server this doesn't fire and i have to manually run Event.captureInput() in my console to get it woring, on codepen though it works fine
Hello everyone,
in a responsive layout which is arranged by using flexbox, how would I achieve an element to span 100% width, like in the following example?
I want my red background of the ul to span across the whole length in responsive mode.
(Math.pow(10,16) - 1); // 10000000000000000
Promise.all[fetch('/'),fetch('/'),fetch('/')]).then(console.log)
which again I was expecting as a single-request