Skip to content

Instantly share code, notes, and snippets.

@matthieua
Created June 13, 2019 12:19
Show Gist options
  • Save matthieua/f5b117666a8ca0031d94aa735d6bbdfc to your computer and use it in GitHub Desktop.
Save matthieua/f5b117666a8ca0031d94aa735d6bbdfc to your computer and use it in GitHub Desktop.
math
<html>
<head> </head>
<body>
<h1>Math</h1>
<script>
let temperature = 19.7;
temperature = Math.round(temperature);
console.log(temperature);
let morningTemperature = 11;
let eveningTemperature = 10;
let minimumTemperature = Math.min(morningTemperature, eveningTemperature);
console.log(minimumTemperature);
let maximumTemperature = Math.max(morningTemperature, eveningTemperature);
console.log(maximumTemperature);
console.log(
`Here is a random number between 0 and 100: ${Math.round(
Math.random() * 100
)}`
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment