diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..6f3a2913e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/assignments/lambda-classes.js b/assignments/lambda-classes.js index 71acfca0e..1ae87e228 100644 --- a/assignments/lambda-classes.js +++ b/assignments/lambda-classes.js @@ -1 +1,19 @@ -// CODE here for your Lambda Classes +class Lambda{ + constructor (attributes){ + this.instructor = attributes.instructor; + this.students = attributes.students; + this.projectManagers = attributes.projectManagers; + } +} +const webeu5 = new Lambda({ + instructor: 'Remi', + students: 'webeu5', + projectManagers: 'Matt Locklin', +}); +let webeu6 = new Lambda({ + instructor: 'Petar', + students: 'webeu6', + projectManagers: 'Debra', +}); +console.log(webeu4); +console.log(webeu6); diff --git a/assignments/prototype-refactor.js b/assignments/prototype-refactor.js index 91424c9fa..44eaa861d 100644 --- a/assignments/prototype-refactor.js +++ b/assignments/prototype-refactor.js @@ -7,3 +7,23 @@ Prototype Refactor 2. Your goal is to refactor all of this code to use ES6 Classes. The console.log() statements should still return what is expected of them. */ +function LambdaPersonnel(attributes){ + this.instructor = attributes.instructor; + this.students = attributes.students; + this.projectManagers = attributes.projectManagers; +} +LambdaPersonnel.prototype.learn = function(){ + return `${this.instructor}: teaches Javascript, ${this.students}`; +} +function Kids(attributes) { + LambdaPersonnel.call(this, attributes); +} +Kids.prototype = Object.create(LambdaPersonnel.prototype); + +const webeu4 = new LambdaPersonnel({ + instructor: 'Remi', + students: 'webeu4', + projectManagers: 'Matt Locklin', +}); + +console.log(webeu4);