diff --git a/Students/kamala/task3.js b/Students/kamala/class_task1.js similarity index 100% rename from Students/kamala/task3.js rename to Students/kamala/class_task1.js diff --git a/Students/kamala/task4.js b/Students/kamala/class_task2.js similarity index 100% rename from Students/kamala/task4.js rename to Students/kamala/class_task2.js diff --git a/Students/kamala/dom.html b/Students/kamala/dom.html new file mode 100644 index 0000000..080ba38 --- /dev/null +++ b/Students/kamala/dom.html @@ -0,0 +1,53 @@ + + + + Color Change + + + + + + + + + + + \ No newline at end of file diff --git a/Students/kamala/index.html b/Students/kamala/index.html index 0110afc..19ecb64 100644 --- a/Students/kamala/index.html +++ b/Students/kamala/index.html @@ -1,10 +1,54 @@ + - + Document + + google + + - \ No newline at end of file + + + \ No newline at end of file diff --git a/Students/kamala/index1.html b/Students/kamala/index1.html new file mode 100644 index 0000000..1003ced --- /dev/null +++ b/Students/kamala/index1.html @@ -0,0 +1,84 @@ + + + +Todo List + + + + +
+

To Do List

+ + + + + + +
+ + + + + \ No newline at end of file diff --git a/Students/kamala/learn1.js b/Students/kamala/learn1.js new file mode 100644 index 0000000..d66a95d --- /dev/null +++ b/Students/kamala/learn1.js @@ -0,0 +1,17 @@ +const learn={ + name: "Sita", + age: 20, + cources : ["python","ML","Django"],"present days":['sun','mon','tue'] +}; +//update cources +learn.cources=["UI/UX",'Development'] +//add new property +learn.grade="class2" + +const info={ + name:"Ram", + grade:"class4" +} +console.log({...learn, ...info}); + +// console.log(learn); \ No newline at end of file diff --git a/Students/kamala/script.js b/Students/kamala/learn2.js similarity index 100% rename from Students/kamala/script.js rename to Students/kamala/learn2.js diff --git a/Students/kamala/scriptt.js b/Students/kamala/learn3.js similarity index 100% rename from Students/kamala/scriptt.js rename to Students/kamala/learn3.js diff --git a/Students/kamala/learn4.js b/Students/kamala/learn4.js new file mode 100644 index 0000000..5c01cdf --- /dev/null +++ b/Students/kamala/learn4.js @@ -0,0 +1,44 @@ +// const letslearnUsersArray=[{ +// name:"saugat Bagale", +// age:23, +// isLogin:true +// },{ +// name:"Nishant", +// age:24, +// isLogin:false +// }, +// { +// name:"Aakriti", +// age:22, +// isLogin:true +// }, +// { +// name:"subin", +// age:19, +// isLogin:false +// }, +// { +// name:"kamala", +// age:19, +// isLogin:true +// }, +// { +// name:"suman", +// age:19, +// isLogin:false +// }, + +// ]; +// for (let user of letslearnUsersArray) { +// console.log(user.name); +// } +const MarbalHeros = ["Iron Man","Captain America","Thor","Hulk","Black Widow","Hawkeye"]; + +function concactHeros(value){ + for (const hero of object.values(value)) { + + console.log(hero); + } +} + +concactHeros(MarbalHeros); \ No newline at end of file diff --git a/Students/kamala/learn5.js b/Students/kamala/learn5.js new file mode 100644 index 0000000..39372d1 --- /dev/null +++ b/Students/kamala/learn5.js @@ -0,0 +1,24 @@ +// const studentScores =[ +// 10,85,92,78,88,95,80 +// ]; +// const total=studentScores.reduce(function(total,current){ +// console.log("value:",total,current) +// return total+ current +// },0); +// console.log("Total Marks Sum :",total) + +// for in use +const array={ + name:"Adhikari", age:20,email:"adhikari@gmail.com" +} +for (const key in array){ + console.log(array[key]) +} +// for of use + +const array2={ + name:"Adhikari", age:20,email:"adhikari@gmail.com" +} +for (const [key, value] of Object.entries(array2)) { + console.log(key, value) +} diff --git a/Students/kamala/checkout.js b/Students/kamala/task1.js similarity index 100% rename from Students/kamala/checkout.js rename to Students/kamala/task1.js diff --git a/Students/kamala/task2.js b/Students/kamala/task2.js index d66a95d..0b32b7c 100644 --- a/Students/kamala/task2.js +++ b/Students/kamala/task2.js @@ -1,17 +1,90 @@ -const learn={ - name: "Sita", - age: 20, - cources : ["python","ML","Django"],"present days":['sun','mon','tue'] -}; -//update cources -learn.cources=["UI/UX",'Development'] -//add new property -learn.grade="class2" - -const info={ - name:"Ram", - grade:"class4" +// Recommended Task: "The E-Commerce Inventory Manager" +// Objective: +// Build a system to manage products in a store using functions to automate tasks and objects to store complex data. + + +// Create an empty array called inventory. +let inventory=[] + +// Create a function called createProduct(name, price, quantity). +// This function should return an object with those three properties. +// Call this function three times to create these items and add them to your inventory array: +// "Laptop", 1200, 10 +// "Mouse", 25, 50 +// "Keyboard", 100, 20 +function createProduct(name, price, quantity){ + let products= { + "name":name, + "price":price, + "quantity":quantity + }; + return products + +} + +let p1=createProduct("Laptop",1200,10) +let p2=createProduct("Mouse",25,50) +let p3=createProduct("Keyboard",100,20) + +inventory=[p1,p2,p3]//all data was overridden by `p3 + +// Updating Data (Accessing Constraints) + +// Oh no! The "Mouse" price was wrong. Access the second item in your inventory array and update its price to 30. +// Access the "Laptop" (first item) and add a new property category with the value "Electronics". +inventory[1].price=30 +console.log("After increasing mouse price",inventory) + +// Access the "Laptop" (first item) and add a new property category with the value "Electronics". +// Merging Product Details (Spread Operator): +inventory[0].category="Electronics" +console.log("After adding the category on p1",inventory) +// Create an object called extraDetails with { warranty: "2 years", color: "Silver" }. +// Create a new variable updatedLaptop by merging the first item in your inventory with extraDetails using the spread operator (...). +// Console log updatedLaptop to see the combined result. + +const extraDetails={ + warranty:"2 years", + color:"Silver" +} + +let updatedLaptop={...inventory[0],...extraDetails} +console.log(updatedLaptop) + +// The Sale Function (Arrow Functions): + +// Write an Arrow Function called calculateTotalValue. +// It should accept two parameters: price and quantity. +// It should return the total value (price * quantity). +// Use this function to calculate the total value of the "Keyboard" stock (from your inventory) and log it. + +const calculateTotalValue=(price,quantity)=>{ + return (price*quantity) } -console.log({...learn, ...info}); +const totalValOfKeyboard=calculateTotalValue(inventory[2].price,inventory[2].quantity) +console.log("The total value of Keyboard is",totalValOfKeyboard) + +// Nested Data Challenge: + +// Create a user object called adminUser with: +// name: "Manager" +// permissions: A nested object { canEdit: true, canDelete: false } +// Write an if statement: If adminUser.permissions.canEdit is true, console log "Access Granted: Inventory updated." +// Why this works: +// Functions: They practice passing arguments (name, price) effectively. +// Objects: They learn to store grouped data instead of just single variables. +// Spread: Real-world use case (adding extra specs to a product). +// Nested Access: Reviewing how to dig into data (user.permissions.canEdit). + + const adminUser={ + name:"Manger", + permissions:{ + canEdit:true, + canDelete:false + } + } + + if (adminUser.permissions.canEdit ===true){ + console.log("Access Granted: Inventory updated!!!!") -// console.log(learn); \ No newline at end of file + } \ No newline at end of file diff --git a/Students/kamala/task3.html b/Students/kamala/task3.html new file mode 100644 index 0000000..e627620 --- /dev/null +++ b/Students/kamala/task3.html @@ -0,0 +1,23 @@ + + + + + + Color change + + + + + + + \ No newline at end of file