Skip to content

Instantly share code, notes, and snippets.

@HoverBaum
Last active June 23, 2016 06:51
Show Gist options
  • Save HoverBaum/3dcd4e17398a6310e4af5c9223d39b8d to your computer and use it in GitHub Desktop.
Save HoverBaum/3dcd4e17398a6310e4af5c9223d39b8d to your computer and use it in GitHub Desktop.
An example of JavaScript syntax for code highlighters.
/*
This file is build to have somehting to paste into code highlighters or editors and see how they display JavaScript.
It therefor includes many random things you might do in JS.
*/
function hello() {
var hello = 'hello'
let world = "world"
const helloWorld = hello + ` ${world}`
return(helloWorld)
}
//Print "hello world" to the console
hello()
const sayHello = (name = 'friends') => {
let person = {
trimmedName: name.trin(),
date: Date.now(),
name
}
//Check if it is Bob
if(/^Bob/.test(name)) return 'Hello Bob'
let age = 13 //People like to be 13
person.age = age
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment