// call , apply, bind //1. How to use bind() feature in javascript with example let button = function(content) { this.content = content; }; button.prototype.click = function() { console.log(`${this.content} clicked `); }; let newbtn = new button('add'); let boundclick = newbtn.click.bind(newbtn); boundclick(); //2. bind() using async funs let myobj = { asyncGet(cb) { cb(); }, parse() { console.log('parse called'); }, render() { this.asyncGet(function() { this.parse(); }.bind(this)) } }; myobj.render(); // ----------------------------JS Coding Test------------------------------------ //1. What does the following statement declares? var myArray = [ [ [] ] ]; // A. 3 dimension array //2.Question: What value is returned from the above statement? var test = "i'm a lasagna hog".split("").reverse().join(""); //Answer: "goh angasal a m'i" //3. What is returned ? ...
A foundation you can build.