This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Hello ui-router</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body ng-app="HelloWorld"> | |
<header> | |
<nav> | |
<ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IComponentLoader { | |
data: any; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IteratorDemo { | |
// Iterator Method with @@iterator key | |
// i.e. Symbol.iterator constant | |
[Symbol.iterator]() { | |
// Method stub which returns an iterator object. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RangeIterator { | |
constructor({ | |
start = 0, | |
end = 1000, | |
step = 1 | |
}) { | |
this.start = start; | |
this.end = end; | |
this.step = step; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RangeGenerator { | |
constructor({ | |
start = 0, | |
end = 1000, | |
step = 1 | |
}) { | |
this.start = start; | |
this.end = end; | |
this.step = step; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
constructor(value) { | |
this.value = value; | |
this.next = null; | |
} | |
} | |
class LinkedList { | |
constructor() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Iterator function. | |
* | |
* @returns | |
* @memberof LinkedList | |
*/ | |
[Symbol.iterator]() { | |
let current = this.head; | |
const iterable = { | |
next: () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generator function. | |
*[Symbol.iterator]() { | |
let current = this.head; | |
while (current !== null) { | |
const { value } = current; | |
current = current.next; | |
yield value; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stack { | |
constructor() { | |
this.list = new LinkedList(); | |
} | |
get isEmpty() { | |
return this.list.isEmpty; | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BinaryTreeNode } from './BinaryTreeNode'; | |
export class BinaryTree { | |
constructor() { | |
this.root = null; | |
} | |
get isEmpty() { | |
return this.root === null; | |
} |
OlderNewer