This file contains 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
//Calculating the BMI | |
function BMI(weight , height){ | |
var calcBmi = (weight/(height**2)); | |
return Math.floor(calcBmi*10)/10; | |
} |
This file contains 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
//Leap year | |
function leapYear(year){ | |
if ( year % 4 == 0 ){ | |
if( year % 100 == 0){ | |
if( year % 400 == 0 ){ | |
return "IS Leap Year"; | |
} else { | |
return"NOT Leap Year"; |
This file contains 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
console.log( | |
'%c ', | |
'background-size: 20px 20px; background: url(https://salmatrip.ir/images/Group.png); padding: 100px 100px; background-repeat: no-repeat ', | |
); |
This file contains 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
const reloadCount = sessionStorage.getItem('reloadCount'); | |
if (reloadCount < 1) { | |
sessionStorage.setItem('reloadCount', String(reloadCount + 1)); | |
window.location.reload(); | |
} else { | |
sessionStorage.removeItem('reloadCount'); | |
} |