This file contains hidden or 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 GoodBoyEvaluator from "./GoodBoyEvaluator"; | |
class Dog { | |
private gotCookie: boolean; | |
public name: string; | |
constructor (name) { | |
this.name = name; | |
} |
This file contains hidden or 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
interface AnimalCompare { | |
isDog (): boolean | |
} | |
class Cat implements AnimalCompare {...}; | |
class Dog implements AnimalCompare {...}; | |
const animals = [ | |
new Cat, | |
new Dog, |
This file contains hidden or 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 express, { Request, Response } from "express"; | |
const app = express(); | |
interface Request { | |
isDogRequest: boolean | |
} | |
app.use("/dogs", (req: Request, res: Response, next) => { | |
req.isDogRequest = true; // <-- does not cause an error | |
next(); |
This file contains hidden or 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
interface Point { x: number; } | |
interface Point { y: number; } | |
const point: Point = { x: 1, y: 2 }; |
This file contains hidden or 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
// Great to express "something" in your app. | |
type Point = { | |
x: number | |
y: number | |
} | |
// Great to make your function params easy to understand | |
function drawPoint (point: Point) { | |
// do stuff | |
} |
This file contains hidden or 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 Dog { | |
isDog () { | |
return true; | |
} | |
} | |
// This is fine | |
var dog: Dog; | |
// This is wrong, Syntax error 'Dog' has already been declared. | |
var Dog; |
This file contains hidden or 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
type Cat = { name: string, purrVelocity: number }; | |
var Cat = { slideStuffOffTheTable = true }; |
This file contains hidden or 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 * as vegetalLib from "some-weird-vegetal-lib"; | |
let eatable = [ | |
"banana", "apple", "watermelon", "tomato", "carrot", | |
"cucumber", "lettuce", "kiwi", "orange" | |
]; | |
function isWidelyAcceptedVegetable (eatable) { | |
let validLexically = vegetableLib.lexicalCheck(eatable); | |
let isTomato = vegetableLib.isTomato(eatable); |
This file contains hidden or 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 * as vegetalLib from "some-weird-vegetal-lib"; | |
let eatables = ["banana", "apple", "watermelon", "tomato", "carrot", "cucumber", "lettuce", "kiwi", "orange"]; | |
function findWidelyAcceptedAsVegetable (eatables) { | |
return eatables.filter(eatable => vegetableLib.lexicalCheck(eatable) && vegetableLib.debatable(eatable) ? !vegetableLib.isTomato(eatable) : true); | |
} |
This file contains hidden or 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
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="600" > | |
<tr> | |
<td style="background-color: #ffffff;"> | |
<img src="https://sudo-website-production.s3.ca-central-1.amazonaws.com/email-thumbnails/line.jpg" width="500" height="20" alt="alt_text" border="0" style="width: 600px; height: auto; background: white; font-family: sans-serif; font-size: 15px; line-height: 15px; color: white; margin: auto; display: block; text-align: left;" class="g-img"> | |
</td> | |
</tr> | |
<!-- Clear Spacer : BEGIN --> | |
<tr> |