This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pierwotny kod: | |
const v = 100; | |
const t = 0.23; | |
const r = v + (v * t); | |
console.log(r); | |
// Po zmianach: | |
const netPrice = 100.0; | |
const vatRate = 0.23; | |
const grossPrice = netPrice + (netPrice * vatRate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pierwotny kod: | |
if (user.isLoggedIn && user.subscription.isActive && !user.isBlocked && user.hasCompletedProfile) { | |
// pozwól na dostęp do treści premium | |
} | |
// Po zmianach: | |
function hasPremiumAccess(user) { | |
return user.isLoggedIn && | |
user.subscription.isActive && | |
!user.isBlocked && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pierwotny kod: | |
setTimeout(handleTimeout, 15000); | |
// Po zmianach: | |
const REQUEST_TIMEOUT_MS = 15000; | |
setTimeout(handleTimeout, REQUEST_TIMEOUT_MS); | |