Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Commit

Permalink
Update JS demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jolaleye committed Mar 8, 2019
1 parent 26286c2 commit 5e7e1fe
Showing 1 changed file with 38 additions and 34 deletions.
72 changes: 38 additions & 34 deletions demos/js.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
class Banana {
constructor(goodOrNah) {
this.quality = goodOrNah;
}

eat() {
// omnomomnomom
const om = 'om\nnom';
}

static peelTime(length) {
const magicNumber = 123;
return length * magicNumber;
class Class {
constructor() {}
static staticMethod() {
this.something;
}
}
const c = new Class();
c.staticMethod();

const banana = new Banana(10);
banana.eat();
console.log(Banana.peelTime(100));
function func(param) {
return;
}
func();

const tl = `Blah blah ${blah} ${blah()} ${blah[0]} blah`;
const num = 123;
let string = 'string';

function makeBanana(num) {}
// comment

for (let i = 0; i < 10; i++) {
makeBanana();
}
for (const thing of stuff) {}
for (let thing in stuff) {}
console.log();

const regex = /banana/;
const regexdos = /[.*+?^${}()|[\]\\]/g;
const obj = {
a: 1,
b: '2',
c: true
};

if (true) {}
while (true) {}
if (something) {
} else if (somethingElse) {
} else {
}

switch (fruit) {
case 'banana':
switch (thing) {
case 'blah':
break;
default:
break;
}

const asyncFetchBananas = async () => {
let bananas = await findBananas();
const template = `${obj.b} abcdefghijk ${elemeno} pqrstuvwxyz ${func()}`;

for (let i = 0; i < 10; i++) {}
for (const thing of stuff) {
}
for (const thing in stuff) {
}
while (false) {}

const regex = /^abc|def[A-Z]$/gim;

const specialBanana = new Banana(11);
bananas.push(specialBanana);
}
const asyncFunc = async () => {
await operation();
};

0 comments on commit 5e7e1fe

Please sign in to comment.