calculator-partexercise-bp5
Version:
This is a exercise for learning npm init
19 lines (13 loc) • 444 B
JavaScript
const date = require('moment-jalaali');
date.loadPersian({usePersianDigits: true});
// baraye tamrin bishtar omadam in dafe getMoment ham export kardam ta dar
// file resudual azash estefade konam.
function getMoment(){
return date().format('jYYYY/jMM/jDD');
}
// function power
function power(a,b){
const c = a ** b;
return `${a} powered ${b} is equal to ${c} | in ${getMoment()}`
}
module.exports = power;