javascript coding code example

Example 1: js code

//A javascript coding example.
var emotion = "happy";
var time = 1614;
var name = "Ruby";
var day = "morning";

if ( time < 1200 ) {
  day = "morning";
};
else if ( time < 600 || time > 2200 ) {
  day = "night";
};
else {
  day = "afternoon";
};

console.log("at " + time + "at " + day + ". " + name + "was felling quite" + emotion + ".");

Example 2: javascript code

html>
<head>
  <title>Multiplication Table</title>
  <script type="text/javascript">
    var rows = prompt("How many rows for your multiplication table?");
    var cols = prompt("How many columns for your multiplication table?");
    if(rows == "" || rows == null)
   		 rows = 10;
    if(cols== "" || cols== null)
   		 cols = 10;
    createTable(rows, cols);
    function createTable(rows, cols)
    {
      var j=1;
      var output = "<table border='1' width='500' cellspacing='0'cellpadding='5'>";
      for(i=1;i<=rows;i++)
      {
    	output = output + "<tr>";
        while(j<=cols)
        {
  		  output = output + "<td>" + i*j + "</td>";
   		  j = j+1;

Example 3: javascript

JavaScript is a Object-Oriented Programming Language. It is very easy, making it high level.

Example 4: javascript code

function getIntoAnArgument() {
    var args = arguments.slice();
    args.forEach(function(arg) {
        console.log(arg);
    });
}

Example 5: javascript

JavaScript is a text-based programming language used both on the client-side
and server-side that allows you to make web pages interactive.
Where HTML and CSS are languages that give structure and style to web pages,
JavaScript gives web pages interactive elements that engage a user.

Example 6: javascript

console.log("JavaScript is the most powerful and most efficient language in the world")
//Here's Why
You can manage the Server with this using Node.JS and Express.Js

These are the most famous libs for JS 

For Building Mobile App
. React Native and Redux

For Building Windows App

. Electron

For Machine learning
. TensorFlow JS

Tags:

Php Example