Factset written test

Factset written test

by Reddy Uppathi

HTML

<!DOCTYPE html>
<html>
<body>

<h2>HTML Image</h2>
<img src="https://www.w3schools.com/html/img_girl.jpg" alt="Girl in a jacket" class="img-1" width="500" height="600">

<script>
var img1 = document.querySelector('.img-1');

function loaded() {
  // woo yey image loaded
  alert("l")
}

if (img1.complete) {
alert("LLLL")
  loaded();
}
else {
  img1.addEventListener('load', loaded);
}

img1.addEventListener('error', function() {
  // argh everything's broken
  alert("noImg")
});
</script>
</body>
</html>

JavaScript

var x = 5,
  y = 10;
var z = x + y;
console.info(z); //15

console.log(typeof typeof typeof(undefined)) // strring

function output() {
  console.log(0);
  setTimeout(function() {
    console.log(1)
  }, 1000);
  setTimeout(function() {
    console.log(2)
  }, 0)
  console.log(3);
}

output(); //0 3 2 1

var abc = {
  foo: "bar",
  func: function() {
    var self = this;
    console.log(self.foo + "," + this.foo) // bar,bar
  }
}
abc.func();

var a = 10;
console.log(a); // 10
var b = 20;
a = b;
console.log(a); // 20


var abc = [1,2]
abc[1] = 24;
abc.length = 0;

console.log(abc[1]); // undefined

function multiEq() {
	var a1 = b1 = 10;
	console.log(a,b) // 10 10
}
multiEq()
console.log(a1,b1) // a1 is not defined

var x1 = [typeof x, typeof y][1];
  console.log(typeof typeof x1); // string