Created
May 7, 2018 17:57
-
-
Save bowdenk7/38f2306b19bffe6749f6b574eea337d2 to your computer and use it in GitHub Desktop.
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
Object.defineProperty(window, "HelloTypeScript", { value: "v1.0.0", writable: false }); | |
function deliveryMethod() { | |
var deliveryElement = document.querySelectorAll('#deliveryMethod'); | |
if (deliveryElement) { | |
return deliveryElement[0].textContent; | |
} | |
else { | |
return undefined; | |
} | |
} | |
function shipWeight() { | |
return parseInt(document.getElementById('weight').textContent); | |
} | |
/* | |
* @param {(string | string[])} emailAddr - An email address of array of email addresses | |
*/ | |
function sendUpdates(emailAddr) { | |
function sendEmail(addr) { | |
if (shipWeight() > 100) { | |
console.log("WARNING: Oversize package"); | |
} | |
} | |
// if its an array, loop over it | |
if (Array.isArray(emailAddr)) { | |
emailAddr.forEach(function (val, idx) { | |
sendEmail(val.trim()); | |
}); | |
} | |
else { | |
sendEmail(emailAddr.trin()); | |
} | |
} | |
class Foo { | |
constructor(a: number, b: string) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment