{
"firstName": "Julien",
"lastName": "Roche",
"age": 35,
"works@": "Viseo Technologies",
"tags": [
"JavaScript", "NodeJs", "Angular", "Backbone",
"Grunt", "Gulp", "Bower", "Jspm", "Karma", "Mocha / Chai / Sinon",
"HTML5", "CSS3", "Less", "Stylus",
"Java", "Spring", "Hibernate", "JPA",
"..."
]
}
<body contextmenu="share">
<menu type="context" id="share">
<menu label="share">
<menuitem label="Twitter" onclick="shareViaTwitter()"></menuitem>
<menuitem label="Facebook" onclick="shareViaFacebook()"></menuitem>
</menu>
</menu>
</body>
<details>
<summary>Some details</summary>
<p>More info about the details.</p>
</details>
<dialog open>
<p>Greetings, one and all!</p>
</dialog>
addEventListener(document, 'scroll', function(event) {
console.log(event.defaultPrevented); // will be false
event.preventDefault(); // does nothing since the listener is passive
console.log(event.defaultPrevented); // still false
}, { 'passive': true });
const foo = document.querySelector('#foo');
foo.addEventListener('pointerdown', ev => {
console.log('Button down, capturing!');
// Every pointer has an ID, which you can read from the event.
foo.setPointerCapture(ev.pointerId);
});
foo.addEventListener('pointerup', ev => console.log('Button up. Every time!'));
// Connect to the channel named "my_bus".
const channel = new BroadcastChannel('my_bus');
// Send a message on "my_bus".
channel.postMessage('This is a test message.');
// Listen for messages on "my_bus".
channel.onmessage = function(e) {
console.log('Received', e.data);
};
// Close the channel when you're done.
channel.close();
function resolveAfter2Seconds(x) {
return new Promise(resolve => {
setTimeout(() => {
resolve(x);
}, 2000);
});
}
async function add1(x) {
var a = resolveAfter2Seconds(20);
var b = resolveAfter2Seconds(30);
return x + await a + await b;
}
add1(10).then(v => {
console.log(v); // prints 60 after 2 seconds.
});
function readonly(target, key, descriptor) {
descriptor.writable = false;
return descriptor;
}
class Cat {
@readonly
cute = true;
}
https://prop-tc39.now.sh/
Text
Text
Text
Text