This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For candidates between 0.6-2 years | |
1) Anagram in Javascript | |
function compare(w1,w2){ | |
var word1 = w1.split("").sort().join(""); | |
var word2 = w1.split("").sort().join(""); | |
if(word1 === word2){ | |
console.log('anagrams'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1)Print squares of first n natural numbers without using *, / and - | |
Input: n = 6 | |
Output: 0 1 4 9 16 25 | |
O(n) time | |
solution In Javascript | |
var square =0,prev=0; | |
function printSquares(n){ | |
for(var x=0;x<n;x++){ | |
square = (square+x+prev); | |
//console.log('x'+x);console.log('prev'+prev);console.log('square+x+prev'+square); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IE10 introduces the MSPointer events, which normalize mouse/touch/pen inputs in IE10. | |
Another new aspect of IE10 is the ms-touch-action CSS property. | |
This CSS property tells IE10 whether to permit default touch behavior or not. | |
When using touch property we need to set ms-touch-action CSS property of the element; | |
-ms-touch-action: auto | none | [ [ [ pan-x || pan-y || pinch-zoom ? ] | manipulation ] || double-tap-zoom ? ] | |
Libraries | |
HammerJS - http://eightmedia.github.com/hammer.js/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34] | |
output | |
4-6,9-10,14-15,20-25,30-31,34 | |
*/ | |
var data=[4,5,6,9,10,14,15,20,21,22,23,24,25,30,31,34,36,37,94,95]; | |
var start=data[0]; | |
var temp=1; | |
var a=0; |