import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
import java.util.TimeZone;
Scanner scan = new Scanner(System.in);
System.out.print("");
int num = scan.nextInt();
scan.close();
TimeZone tz = TimeZone.getTimeZone("UTC");
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
df.setTimeZone(tz);
String time = df.format(new Date(num * 1000));
System.out.println(time);
create a .gitignore file inside that directory that contains these four lines
# Ignore everything in this directory
*
# Except this file
!.gitignore
for (let i = 0; i < 2; i++) {
console.log(i)
}
1. false: the boolean value false
2. 0: the number zero
3. '': the empty string, a string with no characters
4. NaN : stands for "Not a Number", usually caused by math errors
5. undefined: a variable's value before it is assigned a value
6. null: a blank value that can be assigned to a variable
function lessThanFive(numbers) {
for (let number of numbers) {
if (number > 4) {
return false;
}
}
return true;
}
function invert(x) {
if (x === 0) {
return 'input was zero';
} else {
return 1 / x;
}
}
The function will still work using an if statement instead of an if...else statementfunction invert(x) {
if (x === 0) {
return 'input was zero';
}
return 1 / x;
}
press ALT + D
Step 2:
type CMD and pressed Enter
When pressing ALT + D , typing in CMD and pressed Enter when on This PC (and Quick Access) via File Explorer, it opens up the command prompt in the C:\WINDOWS\system32 directory
const EventEmitter = require('events');
class Logger extends EventEmitter {
log(message) {
// Log the message
console.log(message);
// Raise an event
this.emit('messageLogged', { id: 1, url: 'http://' });
}
}
module.exports = Logger;
Content of the index fileconst Logger = require('./logger');
const logger = new Logger();
// Register a listener
logger.on('messageLogged', function(arg) {
console.log('Listener called', arg);
});
logger.log('message');