RandomCheckCTS

all examples

by Samar Pattanayak

HTML

<input type="button" value="Click" id="btnNew"/>

JavaScript

function add(a,b){
	console.log("Sumation is :" + parseInt(a+b));	
  return function(c){
  	console.log(a+b+c);
    return function(value){
    	console.log(value + parseInt(a+b+c));
    };
  };
};
add(2,3)(7)("1st from here");
var a= function(){
	console.log("its a run time function");
};
a();
(function sayHello(){
	console.log("its a compile time function");
})();
var newArray=[12,13,14,15];
var newArray2=new Array(1);
console.log(newArray2.length);
console.log(Array.isArray(newArray));

console.log(newArray[1]);
console.log(Object.prototype.toString.call(newArray));

var obj={
	name: "Samar",
  age: 25
}
function hello(val, val1, val2){
		console.log(this.name+ " is very "+  val + " stays at "+ val1 +" and is very "+ val2);
}
var objArray = ["bad", "Balasore", "nebulous"];
//hello.call(obj, "bad", "Balasore", "nebulous");
//hello.apply(obj, objArray);
var bindObject= hello.bind(obj);
//bindObject("bad", "Balasore", "nebulous");

function parent(name){
	this.name= name;
};
var aObje= new parent("Samar");
console.log(aObje.name);
function child(){	
	parent.call(this,"Kumar");
	this.age=34;
};
child.prototype.constructer = child;
var varb= new child();
console.log(varb.name);

y= 12;
(function test(){
	console.log("****************Example of Hoisting**************")
	console.log(y);
  var y=10;
  console.log(y)
  console.log(fun1);
  console.log(fun2);
  var fun1= function(){
  	console.log("from 1");
  };
	function fun2(){
  	console.log("from 2");
  };
})();
 var anotherOne=document.getElementById("btnNew");
anotherOne.style.color="red";
anotherOne.addEventListener("click", function(){
	console.log("Clicked from button event listner");
  anotherOne.setAttribute("value","Cliked Now, ");
  anotherOne.style.backgroundColor="green";
},false);

var reg= /[0-9]/;
alert(reg.test("samar1"))