const waitXSeconds = (x) => {
return new Promise((resolve, reject) => {
setTimeout(()=>{
resolve('Done!')
}, x * 1000 )
})
}
// Usage
async () => {
// Wait for 5 seconds
await waitXSeconds(5);
// Do something else
// ...
}
Logical Operators: PHP vs JavaScript
I’ve come across this condition from this PR (scroll down to the bottom) and wondered how it really works.
if ( 'object' === typeof window && window.app && window.app.isDebug ) {
// something here
// redacted to focus on the if condition
}
If you want to be great, you’re responsible for making yourself great
If you want to be great, you’re responsible for making yourself great.
This is one of many interesting statements in the book called Code Complete. In reality, this is true for the personal development, not just for the software people. This book gave me the detailed instructions and practices to be great in the software industry.
Continue reading “If you want to be great, you’re responsible for making yourself great”