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"))
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.