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 calculateGrade = (score) => { | |
if (typeof score === "number" | |
&& score <= 100 | |
&& score >= 0 | |
) { | |
if (score >= 80) { | |
return "A"; | |
} else if (score >= 70) { | |
return "B"; | |
} else if (score >= 60) { |
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 calculateGrade = (score) => { | |
if (score >= 80) { | |
return "A"; | |
} else if (score >= 70) { | |
return "B"; | |
} else if (score >= 60) { | |
return "C"; | |
} else if (score >= 50) { | |
return "D"; | |
} else if (score < 50) { |
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
import calculateGrade from "../assets/js/calculateGrade"; | |
describe("calculateGrade", () => { | |
describe("valid cases", () => { | |
describe("when score 80 - 100", () => { | |
it("should return 'A'", () => { | |
const result = calculateGrade(80); | |
const result2 = calculateGrade(100); | |
expect(result).toBe("A"); |
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
import calculateGrade from "../assets/js/calculateGrade"; | |
describe("calculateGrade", () => { | |
describe("when score 80 - 100", () => { | |
it("should return 'A'", () => { | |
const result = calculateGrade(80); | |
const result2 = calculateGrade(100); | |
expect(result).toBe("A"); | |
expect(result2).toBe("A"); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<template> | |
<template v-if="list.length > 0"> | |
<h1>สิ่งที่ฉันชอบ</h1> | |
<ul> | |
<li v-for="listItem in list" :key="listItem">{{ listItem }}</li> | |
</ul> | |
</template> | |
<template v-else> | |
<h1>ไม่มีสิ่งที่ชอบ</h1> | |
<img src="/images/no-item.png" alt="No item"> |
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
<template> | |
<div v-if="list.length > 0"> | |
<h1>สิ่งที่ฉันชอบ</h1> | |
<ul> | |
<li v-for="listItem in list" :key="listItem">{{ listItem }}</li> | |
</ul> | |
</div> | |
<div v-else> | |
<h1>ไม่มีสิ่งที่ชอบ</h1> | |
<img src="/images/no-item.png" alt="No item"> |
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"> | |
<title>Flexbox</title> | |
<style> | |
.container { | |
width: 300px; |
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"> | |
<title>Flexbox</title> | |
<style> | |
.container { | |
width: 300px; |