Menit Belajar Math Javascript Buat Menghitung
#shorts #coding #programming #javascript #frontend
Javascript is a powerful programming language that is commonly used for web development. With Javascript, you can perform various math operations, such as addition, subtraction, multiplication, and division, to name a few. In this article, we will learn how to use Javascript to perform basic math calculations in just 1 minute.
Addition
To perform addition in Javascript, you can use the + operator. For example:
var result = 10 + 5;
console.log(result); // Output: 15
Subtraction
For subtraction, you can use the – operator:
var result = 10 - 5;
console.log(result); // Output: 5
Multiplication
For multiplication, use the * operator:
var result = 10 * 5;
console.log(result); // Output: 50
Division
And for division, use the / operator:
var result = 10 / 5;
console.log(result); // Output: 2
These are just some of the basic math operations you can perform with Javascript. You can also use other math functions and methods to perform more complex calculations. With just a few lines of code, you can use Javascript to perform various math calculations for your web applications.
So, start learning Javascript today and enhance your programming skills!