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
void main() { | |
String username = "Kuria"; | |
print ( sendGreeting(username)); | |
} | |
String sendGreeting(username){ | |
var friendsList = [ | |
"Moses", | |
"Kuria", | |
"Uket", | |
"Regina", |
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
void main() { | |
double hourlyRate = -0.5; | |
int hoursWorked = 12; | |
print(computeWages(hourlyRate , hoursWorked)); | |
} | |
computeWages (hourlyRate , hoursWorked) { | |
var wages = hourlyRate * hoursWorked; | |
if(hourlyRate<=0||hoursWorked<=0){ | |
throw('Negative values not allowed'); | |
} |
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
vvvv |
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(){}()); |
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.", |
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
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
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
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
var user = ( | |
function (){ | |
var name = "faith"; | |
return name; | |
} | |
)(); | |
name; //faith |
OlderNewer