Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/lib/job.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Job{
constructor(title){
this.title = title;
}
}

export var validJobs = ["programmer", "that's it"];
export default Job;
13 changes: 13 additions & 0 deletions app/lib/person.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Job from './job.js';
import {validJobs} from './job.js';
class Person{
constructor(name, job){
this.name = name;
this.job = job;
}
}

var programmer = new Job("Programmer");
var bob = new Person("Bobby", programmer);
console.log(`validJobs are ${validJobs}`);
console.log(`${bob.name} is a ${bob.job.title}`);
22 changes: 22 additions & 0 deletions app/lib/programmer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export var bestLanguages = ["Ruby","Elixir"];

export function addJavaScript(languages) {
var arr = [];
for (var i=0; i<languages.length; i++){
arr.push(languages[i]);
}
arr.push("JavaScript");
return arr;
}

export default class Programmer{
constructor(name,language){
this.name = name;
this.language = language || "Ruby";
}

evangelize(){
return `${this.name}: ${this.language.toUpperCase()} IS THE BEST LANGUAGE EVER`;
}

}