Tech Rocks

Coldfusion
Java
JQuery

An online resource for latest web technologies like Coldfusion, JRun, Pro*C, JQuery, HTML5, PHP, W3C, Java, J2EE, C, C++, ORACLE, PL/SQL, MySql, Ajax, Coldbox, Fusebox, UNIX, JavaScript, NodeJS and much more...

Saturday, June 18, 2016

JavaScript: Understanding the Weird Parts



Examples:

var p = {name: 'a', getName: function(){ return this.name;}}

function greet(p) {
    console.log(p.lastname);
}

console.log(p.getName());
greet(p);
greet({lastname:'mary'});



/*var a;

//a = 0;

if(a || a === 0) {
        console.log(a);
}*/


/*var b;
if((b = 2) * 2 === 4) {
    console.log(b);
}*/



/*function wait3mins() {
    var date = new Date().getTime() + 30000;
    while(new Date() < date) {
        
    }
    console.log("finished");
}

function clickHandler() {
    console.log("clicked");
}

document.addEventListener("click", clickHandler);

wait3mins();
console.log("final finished");*/




/*function a() {
    
    function b() {
        //var i;
        console.log(i);
    }
    
    var i = 10;
    console.log(i);
    b();
}

var i = 20;
console.log(i);
a();*/


/*function b() {
    //var i;
    console.log(i);
}

function a() {
    var i = 10;
    console.log(i);
    b();
}

var i = 20;
console.log(i);
a();*/

/*
var a = "hello";
function b() {
    
    console.log('hello jeetu');
    
}

b();
console.log(a);
*/

/*var a;

if (a === undefined) {
     console.log(a);
} else {
    console.log("defined");
}*/

5 comments :

Karthika Shree said...

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.
Java Training in Chennai

Praylin S said...

Very informative post! I got a lot of idea and information after reading your article. Thanks for your great effort. Keep posting and keep us updated.
Manual Testing Training in Chennai | Manual Testing Courses in Chennai | Manual Testing Training | Manual Testing Training Institute in Chennai | Manual Testing Course | Manual Testing Course in Chennai | Manual Testing Training Chennai

Chris Hemsworth said...

The article is so informative. This is more helpful for our
best software testing training in chennai
best software testing training institute in chennai with placement
software testing training
courses

software testing training and placement
software testing training online
software testing class
software testing classes in chennai
best software testing courses in chennai
automation testing courses in chennai
Thanks for sharing.

Naveen S said...

This is the first & best article to make me satisfied by presenting good content. I feel so happy and delighted.By Learn Digital Marketing Course Training in Chennai it will help to get Digital Marketing Training with Placement Institute in Chennai. If you Learn Social Media Marketing Training with Placement Institute in Chennai, you will get job soon.

Learn Best Digital Marketing Course Training in Chennai in professional institute to get reputed job.

Malcom Marshall said...

Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.

digital marketing course in chennai
digital marketing training in chennai
seo training in chennai
online digital marketing training
best marketing books
best marketing books for beginners
best marketing books for entrepreneurs
best marketing books in india
digital marketing course fees
best seo service in chennai
wordpress bundle
wp starter pack
digital marketing resources
digital marketing blog
digital marketing expert

Post a Comment