Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Celcius.js
- export class Celcius {
- static order = 0;
- static toFahrenheit = (celcius = 1) => {
- return (celcius * 9 / 5) + 32;
- }
- static toKelvin = (celcius = 1) => {
- return celcius + 273.15;
- }
- }
- // Kelvin.js
- export class Kelvin {
- static order = 2;
- static toFahrenheit = (kelvin = 1) => {
- return ((kelvin - 273.15) * 9 / 5) + 32;
- }
- static toCelcius = (kelvin = 1) => {
- return kelvin - 273.15;
- }
- }
- // Fahrenheit.js
- export class Fahrenheit {
- static order = 1;
- static toKelvin = (fahrenheit = 1) => {
- return ((fahrenheit - 32) * 5 / 9) + 273.15;
- }
- static toCelcius = (fahrenheit = 1) => {
- return (fahrenheit - 32) * 5 / 9;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment