marouanekassraoui Goto Github PK
Name: kassraoui marouane
Type: User
Name: kassraoui marouane
Type: User
Skip to content Search or jump to⦠Pull requests Issues Marketplace Explore @marouanekassraoui shariquemulla / javaScript-training 1 00 Code Issues 0 Pull requests 0 Actions Projects 0 Wiki Security 0 Insights javaScript-training/JavaScript Training/objects.js / @shariquemulla shariquemulla Intro to JavaScript 4b57bae 8 days ago 115 lines (89 sloc) 2.68 KB Code navigation is available! Navigate your code with ease. Click on function and method calls to jump to their definitions or references in the same repository. Learn more /* * Programming Quiz: Umbrella (7-1) */ var umbrella = { color: "pink", isOpen: true, open: function() { if (umbrella.isOpen === true) { return "The umbrella is already opened!"; } else { umbrella.isOpen = true; return "Julia opens the umbrella!"; } }, close: function(){ if (umbrella.isOpen === false) { return "The umbrella is already closed!"; } else { umbrella.isOpen = false; return "Julia closes the umbrella!"; } } }; ////////////////////////////////////////////////////////////////////////////////////////////////// /* * Programming Quiz: Menu Items (7-2) */ var breakfast = { name: "The Lumberjack", price: 9.95, ingredients: ["eggs", "sausage", "toast", "hashbrowns", "pancakes"] }; ////////////////////////////////////////////////////////////////////////////////////////////////// /* * Programming Quiz: Bank Accounts 1 (7-3) */ var savingsAccount = { balance: 1000, interestRatePercent: 1, deposit: function addMoney(amount) { if (amount > 0) { savingsAccount.balance += amount; } }, withdraw: function removeMoney(amount) { var verifyBalance = savingsAccount.balance - amount; if (amount > 0 && verifyBalance >= 0) { savingsAccount.balance -= amount; } }, printAccountSummary: function print(){ return "Welcome!" + "\n" + "Your balance is currently $"+ savingsAccount.balance +" and your interest rate is "+ savingsAccount.interestRatePercent +"%."; } }; console.log(savingsAccount.printAccountSummary()); //////////////////////////////////////////////////////////////////////////////// /* * Programming Quiz: Facebook Friends (7-5) */ var facebookProfile = { name: "Sharique Mulla", friends: 150, messages: ["Hi","Hello","Udacity","JavaScript"], postMessage: function msg(message){ facebookProfile.messages.push(message); }, deleteMessage: function deleteMsg(index){ facebookProfile.messages.splice(index,1); }, addFriend: function add(){ facebookProfile.friends++; }, removeFriend:function remove(){ facebookProfile.friends--; } }; /////////////////////////////////////////////////////////////////////////////////////// /* * Programming Quiz: Donuts Revisited (7-6) */ var donuts = [ { type: "Jelly", cost: 1.22 }, { type: "Chocolate", cost: 2.45 }, { type: "Cider", cost: 1.59 }, { type: "Boston Cream", cost: 5.99 } ]; donuts.forEach(function print(element){ console.log(element.type +" donuts cost $"+ element.cost +" each"); }); © 2020 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub Pricing API Training Blog About
The OpenBullet web testing application.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.