These are the features I've wished JavaScript always had, and can't wait to start using.
class Shape {
constructor (id, x, y) {
this.id = id
this.move(x, y)
{ | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"useBuiltIns": "usage", | |
"targets": { | |
"chrome": "58", | |
"ie": "11" | |
} |
<label> | |
Important: We can only hold details of one trip at a time. | |
<input type="checkbox" /> Tick to confirm you have read this. * | |
</label> |
<div class="a11y-help"> | |
Press opt + / to open this menu | |
</div> | |
<div aria-label="Navigation Assistant" aria-keyshortcuts="Alt+/" role="menubar"> | |
<a class="screen-reader-shortcut" tabindex="1" href="#main-content"> | |
Skip to main content | |
</a> | |
</div> |
<amp-iframe src="https://news.files.bbci.co.uk/include/newsspec/15996-trump-tracker/english/index/amp" width="640" height="360"> | |
<!-- some other AMP elements here --> | |
</amp-iframe> |
var customRequest; | |
(function () { | |
function CustomRequestModule () { | |
function isSafeUrl (url) { | |
return url === 'https://safe-site.com'; | |
} | |
function getAccessToken () { | |
return 'my top secret access token'; | |
} |
These are the features I've wished JavaScript always had, and can't wait to start using.
class Shape {
constructor (id, x, y) {
this.id = id
this.move(x, y)
The following tips and tricks have been cherry-picked from 'Cucumber Recipes', by Dees, Wynne and Hellesøy. ~ Chris Ashton
These things are built into Cucumber, and you may not even know it.
Given /^I am on a page for (.+) seconds$/, :visit_the_page
.alignleft { | |
float: left; | |
} | |
.longtext { | |
@text (length < 300) { | |
overflow: hidden; | |
} | |
} |
/* | |
<div class="results"> | |
<div class="results_top"> | |
<h2>Results</h2> | |
</div> | |
<div class="results_bottom"> | |
<div class="share"></div> | |
</div> |
// shamelessly taken from Imager - https://github.com/BBC-News/Imager.js/blob/master/Imager.js | |
// develop your JavaScript library to support RequireJS/CommonJS/vanilla JavaScript | |
;(function (window, document) { | |
'use strict'; | |
var Imager = function () { | |
}; |