- function binary
- setTimeout
setTimeout(function show() {
var snd = new Audio('..src');
snd.play()
}, 500 );
- function digitalClock Conditional (ternary) operator
hours = hours < 10 ? '0' + hours : hours;
minute = minute < 10 ? '0' + minute : minute;
second = second < 10 ? '0' + second : second;
- or uses if/else statement
if(hours<10){
hours="0"+ hours;
} if(minute<10){
minute="0"+ minute;
} if(second<10){
second="0"+ second;
}
- Date Methods new Date()
call this id
days
month
year
function dayMonthYear() {
let currentDay = new Date();
document.getElementById("days").innerText = currentDay.getDate();
let months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
document.getElementById("month").innerHTML = months[currentDay.getMonth()];
document.getElementById("year").innerHTML = currentDay.getFullYear();
setInterval(dayMonthYear, );
} dayMonthYear();
Saidur Rahman Setu
It can be seen at:
https://romanofficial.github.io/Decimal-to-Binary-converter-with-digital-Clock/