<!DOCTYPE html>
<html>
<head>
<title>Welcome to LearnKode - A code learning platform</title>
</head>
<body>
<button onclick="joinArrays()">Concatinate arrays</button>
<p id="sample"></p>
<script>
function joinArrays() {
var countries = ["India", "Pakistan"];
var states = ["Punjab", "Haryana", "Himachal"];
var cities =["Chandigarh","Delhi","Peshawar"];
var result = countries.concat(states,cities);
document.getElementById("sample").innerHTML = result;
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Welcome to LearnKode - A code learning platform</title>
</head>
<body>
<p>Click the button to join three strings into one new string.</p>
<button onclick="joinStrings()">Concatinate strings</button>
<p id="sample"></p>
<script>
function joinStrings() {
var str1 = "Hello ";
var str2 = "everyone!";
var str3 = " Have a nice day!";
var result = str1.concat(str2, str3);
document.getElementById("sample").innerHTML = result;
}
</script>
</body>
</html>