(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta charset="utf-8" /> | |
<script src="templating.js" type="text/javascript" charset="utf-8"></script> | |
</head> | |
<body> | |
<template id=t> |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
function timeToRetire(birthday) { // birthday is a date | |
const RETIREMENT_AGE = 65; | |
let ageDifMs = Date.now() - birthday.getTime(); | |
let ageDate = new Date(ageDifMs); // miliseconds from epoch | |
let age = Math.abs(ageDate.getUTCFullYear() - 1970) | |
let _timeToRetire = RETIREMENT_AGE - age; | |
return _timeToRetire; | |
} |
const RETIREMENT_AGE = 65; | |
function calculateAge(birthday) { | |
let ageDifMs = Date.now() - birthday.getTime(); | |
let ageDate = new Date(ageDifMs); // miliseconds from epoch | |
return Math.abs(ageDate.getUTCFullYear() - 1970) | |
} | |
function calcRetirementTime(age) { | |
return RETIREMENT_AGE - age; |
function printSummary(summary) { | |
// Print the summary data | |
// Re-initialize the summary data | |
} |
function printReport(summary) { | |
} | |
function initialize(summary) { | |
} | |
function printSummary(summary) { | |
printReport(summary); | |
initialize(summary); | |
} |
function completeNewEmployee() { | |
// startup logic here | |
// Read configuration file | |
// Init scratch file | |
// etc | |
// shutdown logic here | |
} | |
function startup() { |
function inputAll(opFlag) { | |
switch(opFlag) { | |
case 'TIME_CARD': | |
// Input all the employee time-card information | |
break; | |
case 'INVENTORY': | |
// Input all the inventory data | |
break; | |
case 'CUSTOMER': | |
// Input all the customer names |
function inputTimeCard(timeCard) { | |
// Input all the employee time-card information | |
} | |
function inputInventory(inventory) { | |
// Input all the inventory data | |
} | |
function inputCustomer(customer) { | |
// Input all the customer names |