From da48dec1e11672a2895bbc98c04a143e12c0cfd4 Mon Sep 17 00:00:00 2001 From: mohammed kaif Date: Sat, 3 Aug 2024 00:42:35 +0500 Subject: [PATCH] js objects practice --- JS-LOGIC-BUILDING-PRACTICE/script.js | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/JS-LOGIC-BUILDING-PRACTICE/script.js b/JS-LOGIC-BUILDING-PRACTICE/script.js index d7d8530..438c4e3 100644 --- a/JS-LOGIC-BUILDING-PRACTICE/script.js +++ b/JS-LOGIC-BUILDING-PRACTICE/script.js @@ -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`); -} \ No newline at end of file +// 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())