1if (expression) {
2 Statement(s) to be executed if expression is true
3} else {
4 Statement(s) to be executed if expression is false
5}
6
1if( ID = josh ):
2 print("ID confirmed")
3 // python
4else:
5 print("ID does not exist")
1if( name = 'george washington'):
2 print("You have the same name as the first president of the United States")
3 // python
4else:
5 print("You do not have the same name as George Washington")
1var price = 500;
2var money = 100;
3
4if (price > money) {
5 console.log("Not Enough")
6} else {
7 console.log("Can Buy")
8}
1const number = (Math.random() - 2.5) * 5;
2if (number < 0) {
3 console.log('Number is negative');
4}
5if (number = 0) {
6 console.log('Number is zero');
7}
8if (number > 0) {
9 console.log('Number is positive');
10}
1var price = 500;
2var money = 100;
3
4if (price > money) {
5 console.log("Not Enough");
6} else {
7 console.log("Can Buy");
8}