본문 바로가기

웹 프로그래밍/JavaScript

[JS] 백틱(backtick) 사용 예제

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
	var a = 10, b = 20, c = 30;
	alert('a : ' + a + ", b : " + b + ", c: " + c);
	alert(`a : ${a} b : ${b} c : ${c}`);

	alert('163 + 845 = ' + (163 + 845));
	alert(`163 + 845 = ${163 + 845}`);
</script>
</head>
<body>

</body>
</html>