You are viewing a single comment's thread. Return to all comments →
JavaScript
i don't understand why it doesn't work this way
if(y1 > y2) return 10000; if(m1 > m2) return 500 * (m1 - m2); if(d1 > d2) return 15 * (d1 - d2); return 0;
but works this way
if(y1 > y2) return 10000; if(m1 > m2 && y1 === y2) return 500 * (m1 - m2); if(d1 > d2 && m1 === m2 && y1 === y2) return 15 * (d1 - d2); return 0;
Seems like cookies are disabled on this browser, please enable them to open this website
Library Fine
You are viewing a single comment's thread. Return to all comments →
JavaScript
i don't understand why it doesn't work this way
but works this way