This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function humanize(num){ | |
var ones = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', | |
'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', | |
'seventeen', 'eighteen', 'nineteen']; | |
var tens = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', | |
'ninety']; | |
var numString = num.toString(); | |
if (num < 0) throw new Error('Negative numbers are not supported.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var car = "audi"; | |
(function (make) { | |
return make; | |
})(car); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(()=>{ | |
//do something | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function () { | |
//do something | |
} | |
)(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var user = ( | |
function (){ | |
var name = "faith"; | |
return name; | |
} | |
)(); | |
name; //faith |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const quotes = [ | |
{ quote: "You're only as sick as your secrets.", author: "Anonymous" }, | |
{ | |
quote: "To remain young one must change.", | |
author: "Alexander Chase", | |
}, | |
{ | |
quote: | |
"Those who seek happiness miss it, and those who discuss it, lack it.", | |
author: "Holbrook Jackson", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateQuote() { | |
var randomIndex = Math.floor(Math.random()*quotes.length); | |
document.getElementById("quote").innerHTML=quotes[randomIndex].quote; | |
document.getElementById("author").innerHTML="~"+ " " + quotes[randomIndex].author; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
height: 100vh; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
background-color: #2d3436; | |
background-image: linear-gradient(315deg, #2d3436 0%, #000000 74%); | |
} | |
#quote-box { | |
width: 60vw; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<link | |
href="https://fonts.googleapis.com/css2?family=Cookie&display=swap" | |
rel="stylesheet" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
const quotes = [ | |
{ quote: "You're only as sick as your secrets.", author: "Anonymous" }, | |
{ | |
quote: "To remain young one must change.", | |
author: "Alexander Chase", | |
}, | |
{ | |
quote: | |
"Those who seek happiness miss it, and those who discuss it, lack it.", |
NewerOlder