<!--for question 2 -->
In my life, I used the following web search engines:<br/>
<a href="//www.yahoo.com" data-name="yahoo">Yahoo!</a><br/>
<a href="//www.altavista.com" data-name="altavista">AltaVista</a><br/>
<a href="//www.google.com" data-name="google">Google</a><br/>
JavaScript
/*
1) Give an exmaple of javascript inheritance. Create a base class "Car" and create two sub classes "Honda" and "Chevy". Create a function called "hello" which when called, displays the name of the car on the screen. create other functions specific to Honda and Chevy, call all of those functions for both subclasses demonstrating inheritance.
-- answer they should be using prototype and have understanding of how to do inheritance in javascript
*/
/*
2) example of closure, fix errors in this function and
*/
function registerHandlers() {
var as = document.getElementsByTagName('a');
for (i = as.length; i-- >= 0;) {
as[i].onclick = function() {
// write code to display the name on the screen.
}
}
}
/*
3)
What will be the output of this code
*/
function a(){
setTimeout(function(){
console.log('text - A');
},0);
};
function b(){
console.log('text - B');
}
a()
b()
/*
Answer
// 'text - B'
// 'text - A'
*/
/*
4) Angular difference between provider and services, when to use which
*/
/*
5) Explain Dependency injection in frameworks like angular and how they work
*/
/*
6) jQuery.hide/show vs display:none, which is better.
*/
/*
7) Why scripts at the end of the page
*/
/*
8) When to use == and ===
/*
9) Write an html and javascript that inserts the value from the textbox to the top of the array and displays it on screen
*/
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.