Giter Site home page Giter Site logo

feiq's Introduction

feiq

  1. What will be printed to the console?
  let a = 10;
  a.b = 10;
  console.log(a);
Output 10
  1. What storages do save data after closing the browser? (LocalStorage, CookieStorage, SessionStorage)
  2. Promise.reject('a')
     .catch(p => p + 'b')
     .catch(p => p + 'c')
     .then(p => p + 'd')
     .finally(p => p + 'e')
     .then(p => console.log(p))
Output abd
  1. What is the function's [[Scope]] property equal to?

    1. Current Lexical Environment
    2. Current Lexical Environment or window
    3. Function doesn't have such property
    4. Lexical Environment in which this function was called
  2. What is HTMLCollection?

    1. An object with numeric keys containing DOM elements and provides additional methods for working with the collection
    2. Array of DOM elements
    3. Array of DOM elements, that has additional methods to work with this collection
    4. An object with numeric keys containing DOM elements and provides methods for working with them like with an array
  3. What will be printed to the console?

var a = 'hello';
function b() {
    if (false) {
        var a = 'world';
    } else {
        var b = 'man';
    }
    console.log(b);
    console.log(a);
}
b();
Output man, undefined
  1. What will be printed to the console?
const map = new Map();

map.set('0', '1');
map.set('s2', '2s');
map.set('3s', 's3');

const arr = [...map.values()];
const result = arr.map(value => parseInt(value, 10));

console.log(result);
Output [1, 2, NaN]
  1. What will be printed to the console?
var x = 10

function bar(funArg) {
    var x = 30;
    funArg();
}

function foo() {
    console.log(x)
}

foo.x = 20;
bar.x = 40;

bar(foo);
Output 10
  1. What will be printed to the console?
var obj = {
    a: () => {
        console.log(this.prop);
    },
    prop: 1
};

obj.a();
var fn = obj.a.bind(obj);
fn();
Output undefined, undefined
  1. What will be printed to the console if we click three times?
class GODListener {
  constructor() {
      this.counter = 0;
  }

  handleClick() {
      this.counter += 1;
      console.log(this.counter);
  }
}

const element = document.getElementById('testBtn');
const listener = new GODListener();

element.addEventListener('click', listener.handleClick);
Output NaN, NaN, NaN
  1. What will be printed to the console?
var a = {};
(function b(a) {
    a.a = 10;
    a = null;
})(a);
console.log(a);
Output { a: 10 }
  1. What will be printed to the console?
console.log(0 || 200);
console.log(0 ?? 400);
console.log(0 && 600);
Output 200 0 0
  1. What is the return type of this function?
async function Fn() {
    if (await CheckUser()) {
        return 42;
    }

    return undefined;
}
Output Promise<42 | undefined>
  1. What will be printed to the console?
console.log(null == undefined);
console.log(null === undefined);
Output true false

feiq's People

Contributors

baglana avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.