Skip to content

Commit

Permalink
js objects practice
Browse files Browse the repository at this point in the history
  • Loading branch information
MKAIF5 committed Aug 2, 2024
1 parent 6178d2f commit da48dec
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions JS-LOGIC-BUILDING-PRACTICE/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,26 @@
// }
// console.log(abc());

let num1, num2;
if(parseInt(num1 ,10) > parseInt(num2 , 10)){
console.log(`The larger of ${num1} and ${num2} is ${num1} .`);
}
// let num1, num2;
// if(parseInt(num1 ,10) > parseInt(num2 , 10)){
// console.log(`The larger of ${num1} and ${num2} is ${num1} .`);
// }

else if(parseInt(num2 , 10) > parseInt(num1 , 10)){
console.log(`the larger number ${num1} and ${num2} is ${num2}`);
}
// else if(parseInt(num2 , 10) > parseInt(num1 , 10)){
// console.log(`the larger number ${num1} and ${num2} is ${num2}`);
// }

else{
console.log(`The value is ${num1} and ${num2} are equal`);
}
// else{
// console.log(`The value is ${num1} and ${num2} are equal`);
// }

const user = {
username: "kaif",
age: 15,
isLoggin: true,
getUserDetails: function(){
// console.log(`USERNAME: ${this.username}`);
console.log(this);
}
}
console.log(user.getUserDetails())

0 comments on commit da48dec

Please sign in to comment.