use ternary operator in JavaScript output
Merge pull request #17 from davidchambers/ternary

use ternary operator in JavaScript output