Many of the more "advanced" typescript features can be used for creating "value-derived" types.
At its simplest form:
let vehicle = { name: "Van", wheels: 4 }| docker run -v [local path]:/code -it node bash | |
| cd /code | |
| echo "console.log('Hello, World');" > app.js | |
| node app.js | |
| docker run -v [local path]:/code -it microsoft/dotnet bash | |
| cd /code | |
| dotnet new console | |
| dotnet run |
Principles of Adult Behavior
Looking for support tables for HTML/CSS/JavaScript features or details on their implementation status in major browsers?
And then there’s Can I use…?.
| /* | |
| Convert svg files to virtual-dom's VTree | |
| To use the resulting tree | |
| import svg from 'virtual-dom/virtual-hyperscript/svg' | |
| if you use Cycle.js: | |
| import {svg} from '@cycle/dom'; | |
| */ | |
| import fs from 'fs'; |
When a beginner asks you "when do I use semi-colons?" would you rather say this?
// what people who say "use semicolons!!" say
class Foo {
prop = {
}; // yes| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
| { | |
| // http://eslint.org/docs/rules/ | |
| "ecmaFeatures": { | |
| "binaryLiterals": false, // enable binary literals | |
| "blockBindings": false, // enable let and const (aka block bindings) | |
| "defaultParams": false, // enable default function parameters | |
| "forOf": false, // enable for-of loops | |
| "generators": false, // enable generators | |
| "objectLiteralComputedProperties": false, // enable computed object literal property names |
In React's terminology, there are five core types that are important to distinguish:
React Elements
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <title>Render Multiple Outlets</title> | |
| <script src="js/vendor/jquery.js"></script> | |
| <script src="js/vendor/handlebars.js"></script> | |
| <script src="js/vendor/ember.js"></script> | |
| <script src="js/vendor/ember-data.js"></script> | |
| </head> |