Tracker ID: #ADD LINK TO PIVOTAL STORY
Unit tests completed?: (Y/N)
PR Branch #ADD LINK TO PR BRANCH
Code Coverage & Build Info
import Sequelize from 'sequelize'; | |
import UserModel from './models/user'; | |
const sequelize = new Sequelize('<table name>', '<db username>', '<db password>', { | |
host: '<host - could be localhost or service name for docker-compose service>', | |
dialect: 'mysql <or whichever SQL dialect you choose>', | |
}); | |
const User = UserModel(sequelize, Sequelize); |
Tracker ID: #ADD LINK TO PIVOTAL STORY
Unit tests completed?: (Y/N)
PR Branch #ADD LINK TO PR BRANCH
Code Coverage & Build Info
const string1 = 'this is a string in single quotes'; | |
const string2 = "this is a string in double quotes"; |
/* your basic JavaScript strings, but with back-ticks. | |
notice the lack of escape characters needed for things | |
like single quotes, double quotes, and apostrophes | |
when back-ticks are employed */ | |
const fooString = `A string called 'fooString'`; | |
const barString = `Another string named "barString"`; | |
const bazString = `Without fooString and barString, you can't have bazString, right?`; |
function authorize(user, action) { | |
if (!user.hasPermission(action)) { | |
throw new Error( | |
`User ${user.name} is not allowed to ${action}.` | |
); | |
} | |
} | |
const person = { | |
name: "Sean" |
console.log("To make a multi-line string this way\n" + | |
"I have to concatenate two separate strings with a + sign"); | |
/* prints: To make a multi-line string this way | |
I have to concatenate two separate strings with a + sign */ |
console.log(`With template literal back-ticks, I can spread strings across | |
as many lines as I want | |
with | |
no | |
problem.`); | |
/* prints: With template literal back-ticks, I can spread strings across | |
as many lines as I want | |
with | |
no |
const c = 10; | |
const d = 5; | |
console.log('It used to be harder to calculate that ' + (c + d) | |
+ '\n is not the same as ' + (2 * c) + ' in a string.'); | |
/* prints: It used to be harder to calculate that 15 | |
is not the same as 20 in a string. */ |
const c = 10; | |
const d = 5; | |
console.log(`With the syntactic sugar of ES6 template literals, | |
doing math in strings like this: ${c + d} | |
and that: ${2 * c} is a cinch.`); | |
/* prints: With the syntactic sugar of ES6 template literals, | |
doing math in strings like this: 15 | |
and that: 20 is a cinch. */ |
var classes = 'header'; | |
function isDesktopSize(){ | |
window.innerWidth > 1400 ? true : false; | |
}; | |
var navbar = { | |
isOpen: false | |
}; |