1<!--just open a file with the ending of ".js"
2example: myFirstJS.js
3
4an other option is to write this sentence on HTML document:
5-->
6
7<script type="text/javascript">
8//write here your code
9</script>
1//A javascript coding example.
2var emotion = "happy";
3var time = 1614;
4var name = "Ruby";
5var day = "morning";
6
7if ( time < 1200 ) {
8 day = "morning";
9};
10else if ( time < 600 || time > 2200 ) {
11 day = "night";
12};
13else {
14 day = "afternoon";
15};
16
17console.log("at " + time + "at " + day + ". " + name + "was felling quite" + emotion + ".");
1html>
2<head>
3 <title>Multiplication Table</title>
4 <script type="text/javascript">
5 var rows = prompt("How many rows for your multiplication table?");
6 var cols = prompt("How many columns for your multiplication table?");
7 if(rows == "" || rows == null)
8 rows = 10;
9 if(cols== "" || cols== null)
10 cols = 10;
11 createTable(rows, cols);
12 function createTable(rows, cols)
13 {
14 var j=1;
15 var output = "<table border='1' width='500' cellspacing='0'cellpadding='5'>";
16 for(i=1;i<=rows;i++)
17 {
18 output = output + "<tr>";
19 while(j<=cols)
20 {
21 output = output + "<td>" + i*j + "</td>";
22 j = j+1;
1function getIntoAnArgument() {
2 var args = arguments.slice();
3 args.forEach(function(arg) {
4 console.log(arg);
5 });
6}
1console.log("JavaScript is the most powerful and most efficient language in the world")
2//Here's Why
3You can manage the Server with this using Node.JS and Express.Js
4
5These are the most famous libs for JS
6
7For Building Mobile App
8. React Native and Redux
9
10For Building Windows App
11
12. Electron
13
14For Machine learning
15. TensorFlow JS
16
17
18
19