Although this isn't a problem in other languages, because of semicolon insertion, there could be problems if you don't place the bracket on the opening line:
// no:
function()
{
module.exports = (function(){ | |
const MS = | |
{ seconds: 1000 | |
, minutes: 60 * 1000 | |
, hours: 60 * 60 * 1000 | |
, days: 24 * 60 * 60 * 1000 | |
, weeks: 7 * 24 * 60 * 60 * 1000 | |
, months: 30 * 7 * 24 * 60 * 60 * 1000 | |
, years: 365 * 24 * 60 * 60 * 1000 } |
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
var express = require('express') | |
, http = require('http') | |
, connect = require('connect') | |
, io = require('socket.io'); | |
var app = express(); | |
/* NOTE: We'll need to refer to the sessionStore container later. To | |
* accomplish this, we'll create our own and pass it to Express | |
* rather than letting it create its own. */ | |
var sessionStore = new connect.session.MemoryStore(); |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
actions: { | |
prevent(e) { | |
console.log("here we are"); | |
e.preventDefault(); | |
return false; | |
}, |