SlideShare a Scribd company logo
L I V E S C R I P T
( O R / [ C O F F E E ] | [ L I V E ] S C R I P T / G )
R O C K I N G Y O U R W O R L D . J S
Copyright 2014 - Synthesis Software Technology
http://www.synthesis.co.za
J S = F T W & & W T F
LiveScript <| Rocking your world.js
Type coercion strangely-ness
[1,2,3] + [5,6,7] = “1,2,35,6,7”
{} + [] = “[object Object]”
{} - [] = NaN
> typeof NaN
> ?
var x = 500
vs.
x = 500
for (x in [3,4,5]) {
console.log(x);
}
for (x in {1:2,3:4}) {
console.log(x);
}
Q U I Z
Which of the following is NOT a usable
javascript keyword:
a. var
b. with
c. in
d. class
e. undefined
JavaScript keywords:
break, case, catch, continue, debugger, default, delete, do, else,
false, finally, for, function, if, in, instanceof, new, null, return,
switch, this, throw, true, try, typeof, var, void, while, with.
Reserved for future use:
abstract, boolean, byte, char, class, const, double, enum, export,
extends, final, float, goto, implements, import, int, interface,
let, long, native, package, private, protected, public, short,
static, super, synchronized, throws, transient, volatile, yield.
Reserved for browser:
alert, blur, closed, document, focus, frames, history, innerHeight,
innerWidth, length, location, navigator, open, outerHeight,
outerWidth, parent, screen, screenX, screenY, statusbar, window.
S P O T T H E B U G !
var car = {
state: "off",
start: function() {
this.state = "starting";
setTimeout(function() {
this.state = "started"
}, 1000);
}
};
car.start();
P R O T O T Y P A L O O S T Y L E
var Person = function(name) {
return {
name: name,
getname: function() {
return this.name.toUpperCase();
}
}
}
var peter = new Person("Peter");
peter.getname();
var luke = { name: “Luke” };
luke.getname = peter.getname;
luke.getname();
var crazy = peter.getname;
crazy(); // ??
null !== undefined
[coffee|live|type]script
A W H I R L A R O U N D C O F F E E
S C R I P T
syntax
scope
variables
functions
templating
list comp.
== vs. ===
lsc ~= coffee + x
F A T T Y G O O D N E S S
fix coffee’s weirdly-ness (like ‘=‘and list comps)
spicy curry and nice
ninja |> <| >> << operators
async backcalls
A N D B A T T E R I E S !
prelude
more scary compiled js
could be a gateway drug… >:-0
D O W N S I D E S O V E R C O F F E E ?
LiveScript &lt;| Rocking your world.js

More Related Content

ODP
Shell Scripting
dcarneir
 
PPT
Thread介紹
Jack Chen
 
ODT
Spatial script for MongoBoulder
Steven Pousty
 
PDF
Islam House
Haris Padinharethil
 
PDF
忙しい人のためのSphinx 入門 demo
Fumihito Yokoyama
 
PDF
Linux Shell (Expiry of Domain and Certificate)
Paulo Paim
 
PDF
進擊的UX - UX and rapid prototyping @ 元智
伯方 蘇
 
PDF
言語の設計判断
nishio
 
Shell Scripting
dcarneir
 
Thread介紹
Jack Chen
 
Spatial script for MongoBoulder
Steven Pousty
 
Islam House
Haris Padinharethil
 
忙しい人のためのSphinx 入門 demo
Fumihito Yokoyama
 
Linux Shell (Expiry of Domain and Certificate)
Paulo Paim
 
進擊的UX - UX and rapid prototyping @ 元智
伯方 蘇
 
言語の設計判断
nishio
 

What's hot (20)

TXT
Simple php backdoor_by_dk
Stan Adrian
 
PDF
mdpress(MarkDown Press)を使ったプレゼンテーション作成
達郎 植田
 
PPTX
FUNCIONES DE EXCEL
Ildha Slm Undr
 
PPTX
GraphQL Relay Introduction
Chen-Tsu Lin
 
PDF
MongoDB a document store that won't let you down.
Nurul Ferdous
 
PPTX
Introduction to MongoDB for C# developers
Taras Romanyk
 
PDF
Gitkata refspec
Mateusz Grzechociński
 
PDF
Python Developer's Daily Routine
Maxim Avanov
 
PPT
Shell and perl scripting classes in mumbai
Vibrant Technologies & Computers
 
PDF
MySQL Create Table
Hoyoung Jung
 
PDF
Spatial script for Spatial mongo for PHP and Zend
Steven Pousty
 
PPTX
Introduction to Guzzle
DQNEO
 
PPTX
App-o-Lockalypse now!
Oddvar Moe
 
PDF
Derrubando mitos em Python
Denis Costa
 
PDF
DOD 2016 - Tomasz Torcz - The Song of JBoss and Chef
PROIDEA
 
PDF
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
Ryousei Takano
 
PDF
Coding with Vim
Enzo Wang
 
PDF
You Don't Need Lodash
UpsideTravel
 
PPT
第4章 存储器管理实验
guest332a57
 
PDF
PuppetCamp SEA 1 - Version Control with Puppet
Walter Heck
 
Simple php backdoor_by_dk
Stan Adrian
 
mdpress(MarkDown Press)を使ったプレゼンテーション作成
達郎 植田
 
FUNCIONES DE EXCEL
Ildha Slm Undr
 
GraphQL Relay Introduction
Chen-Tsu Lin
 
MongoDB a document store that won't let you down.
Nurul Ferdous
 
Introduction to MongoDB for C# developers
Taras Romanyk
 
Gitkata refspec
Mateusz Grzechociński
 
Python Developer's Daily Routine
Maxim Avanov
 
Shell and perl scripting classes in mumbai
Vibrant Technologies & Computers
 
MySQL Create Table
Hoyoung Jung
 
Spatial script for Spatial mongo for PHP and Zend
Steven Pousty
 
Introduction to Guzzle
DQNEO
 
App-o-Lockalypse now!
Oddvar Moe
 
Derrubando mitos em Python
Denis Costa
 
DOD 2016 - Tomasz Torcz - The Song of JBoss and Chef
PROIDEA
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
Ryousei Takano
 
Coding with Vim
Enzo Wang
 
You Don't Need Lodash
UpsideTravel
 
第4章 存储器管理实验
guest332a57
 
PuppetCamp SEA 1 - Version Control with Puppet
Walter Heck
 
Ad

Similar to LiveScript &lt;| Rocking your world.js (20)

PDF
50 common web developer interview questions [2020 updated] [www.full stack....
Alex Ershov
 
ZIP
Javascript Everywhere
Pascal Rettig
 
PDF
Douglas Crockford: Serversideness
WebExpo
 
PPTX
Awesomeness of JavaScript…almost
Quinton Sheppard
 
PDF
JavaScript 101
ygv2000
 
KEY
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
PDF
Fixing web and JS gaps
Christian Heilmann
 
PPTX
Java Script basics and DOM
Sukrit Gupta
 
PDF
Basics of JavaScript
Bala Narayanan
 
KEY
TxJS 2011
Brian LeRoux
 
KEY
Javascript 基础
Alipay
 
PDF
Damn Fine CoffeeScript
niklal
 
PDF
Javascript: the important bits
Chris Saylor
 
PDF
JavaScript Like It’s 2013
OutSystems
 
PPTX
All of Javascript
Togakangaroo
 
PDF
Javascript Performance
olivvv
 
PPTX
Going offline with JS (DDD Sydney)
brendankowitz
 
PPTX
5 Tips for Better JavaScript
Todd Anglin
 
PPT
jQuery with javascript training by Technnovation Labs
Prasad Shende
 
50 common web developer interview questions [2020 updated] [www.full stack....
Alex Ershov
 
Javascript Everywhere
Pascal Rettig
 
Douglas Crockford: Serversideness
WebExpo
 
Awesomeness of JavaScript…almost
Quinton Sheppard
 
JavaScript 101
ygv2000
 
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
Fixing web and JS gaps
Christian Heilmann
 
Java Script basics and DOM
Sukrit Gupta
 
Basics of JavaScript
Bala Narayanan
 
TxJS 2011
Brian LeRoux
 
Javascript 基础
Alipay
 
Damn Fine CoffeeScript
niklal
 
Javascript: the important bits
Chris Saylor
 
JavaScript Like It’s 2013
OutSystems
 
All of Javascript
Togakangaroo
 
Javascript Performance
olivvv
 
Going offline with JS (DDD Sydney)
brendankowitz
 
5 Tips for Better JavaScript
Todd Anglin
 
jQuery with javascript training by Technnovation Labs
Prasad Shende
 
Ad

Recently uploaded (20)

PPTX
Presentation about variables and constant.pptx
kr2589474
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Presentation about variables and constant.pptx
kr2589474
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Exploring AI Agents in Process Industries
amoreira6
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 

LiveScript &lt;| Rocking your world.js

  • 1. L I V E S C R I P T ( O R / [ C O F F E E ] | [ L I V E ] S C R I P T / G ) R O C K I N G Y O U R W O R L D . J S Copyright 2014 - Synthesis Software Technology http://www.synthesis.co.za
  • 2. J S = F T W & & W T F
  • 4. Type coercion strangely-ness [1,2,3] + [5,6,7] = “1,2,35,6,7” {} + [] = “[object Object]” {} - [] = NaN
  • 6. var x = 500 vs. x = 500
  • 7. for (x in [3,4,5]) { console.log(x); }
  • 8. for (x in {1:2,3:4}) { console.log(x); }
  • 9. Q U I Z Which of the following is NOT a usable javascript keyword: a. var b. with c. in d. class e. undefined
  • 10. JavaScript keywords: break, case, catch, continue, debugger, default, delete, do, else, false, finally, for, function, if, in, instanceof, new, null, return, switch, this, throw, true, try, typeof, var, void, while, with. Reserved for future use: abstract, boolean, byte, char, class, const, double, enum, export, extends, final, float, goto, implements, import, int, interface, let, long, native, package, private, protected, public, short, static, super, synchronized, throws, transient, volatile, yield. Reserved for browser: alert, blur, closed, document, focus, frames, history, innerHeight, innerWidth, length, location, navigator, open, outerHeight, outerWidth, parent, screen, screenX, screenY, statusbar, window.
  • 11. S P O T T H E B U G ! var car = { state: "off", start: function() { this.state = "starting"; setTimeout(function() { this.state = "started" }, 1000); } }; car.start();
  • 12. P R O T O T Y P A L O O S T Y L E var Person = function(name) { return { name: name, getname: function() { return this.name.toUpperCase(); } } } var peter = new Person("Peter"); peter.getname(); var luke = { name: “Luke” }; luke.getname = peter.getname; luke.getname(); var crazy = peter.getname; crazy(); // ??
  • 15. A W H I R L A R O U N D C O F F E E S C R I P T syntax scope variables functions templating list comp. == vs. ===
  • 17. F A T T Y G O O D N E S S fix coffee’s weirdly-ness (like ‘=‘and list comps) spicy curry and nice ninja |> <| >> << operators async backcalls A N D B A T T E R I E S ! prelude more scary compiled js could be a gateway drug… >:-0 D O W N S I D E S O V E R C O F F E E ?

Editor's Notes

  • #2: For recreating highlighted code: brew install highlight cat wtf.js | highlight --syntax=js --style clarity -O rtf | pbcopy
  • #3: It’s everywhere - every single computer in the world runs at least a couple JS interpreters It’s multi-paradigm: OO, functional, dynamic, asynchronous It’s equally loved and hated by developers everywhere But it’s massively WTF too - lots of crazy stuff in there
  • #4: It’s everywhere - every single computer in the world runs at least a couple JS interpreters It’s multi-paradigm: OO, functional, dynamic, asynchronous It’s equally loved and hated by developers everywhere But it’s massively WTF too - lots of crazy stuff in there
  • #5: But whatever - they do actually follow a fairly reasonable convention, just sometimes a bit surprising
  • #10: The evil “with” keyword: with (z) { y = 10; // good luck knowing if z.y or global y is being set }
  • #14: Confusion and badly used generally “undefined” meaning the absence of a definition (similar to void) “null” meaning defined, but set to the absence of a value (similar to null) “==“ operator coercing null to undefined and vice versa, munging their meanings, whereas “===“ works as a better equality operator in most cases
  • #15: Silver bullet languages! Fix all js issues! Except Typescript, which fixes a whole class of “issues” that don’t exist :)
  • #16: var issues (coffeescript has to keep track of variables) do a class example with using -> and => bound functions
  • #18: fixed scoping issue, use := to assign to the global