Newer
Older
Teatime / book-js / answer / 3-08_function / step1 / index.html
@KAOKA Daisuke KAOKA Daisuke on 29 Jan 2022 956 bytes add file
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>3-08_function</title>
<link href="../../_common/images/favicon.ico" rel="shortcut icon">
<link href="https://fonts.googleapis.com/css?family=M+PLUS+1p:400,500" rel="stylesheet">
<link href="../../_common/css/style.css" rel="stylesheet">
</head>
<body>
<header>
<div class="container">
<h1>税込価格を計算する</h1>
<h2>ファンクションを作る・呼び出す</h2>
</div><!-- /.container -->
</header>
<main>
<div class="container">
<section>
    
</section>
</div><!-- /.container -->
</main>
<footer>
<div class="container">
<p>JavaScript Samples</p>
</div><!-- /.container -->
</footer>
<script>
'use strict';

function total(price) {
    const tax = 0.1;
    return price + price * tax;
}

console.log('コーヒーメーカーの値段は' + total(8000) + '円(税込)です。');
</script>
</body>
</html>