Skip to content

Instantly share code, notes, and snippets.

View fhsinchy's full-sized avatar
🎯
Trying to focus

Farhan Hasin Chowdhury fhsinchy

🎯
Trying to focus
View GitHub Profile
let obj1 = {
innerMethod: function () {
console.log(this);
}
};
let func1 = obj1.innerMethod;
func1();
let obj1 = {
innerMethod: function () {
innerFunction();
function innerFunction() {
console.log(this);
}
}
};
let obj1 = {
innerMethod: function () {
let self = this;
innerFunction();
function innerFunction() {
console.log(self);
}
}
};
let obj1 = {};
function func1() {
console.log(this);
}
func1();
func1.bind(obj1)(); // bind returns a function
func1.call(obj1);
func1.apply(obj1);
'use strict'
let func1 = () => {
console.log(this);
};
func1();
// Window
let obj1 = {
innerMethod: () => {
console.log(this);
}
};
obj1.innerMethod();
// Window
let obj1 = {
innerFunction: null,
innerMethod: function () {
this.innerFunction = () => { console.log(this) };
}
};
obj1.innerMethod();
obj1.innerFunction();
let obj1 = {};
let func1 = () => {
console.log(this);
}
func1();
func1.bind(obj1)(); // bind returns a function
func1.call(obj1);
func1.apply(obj1);
CREATE TABLE IF NOT EXISTS blogs (
id int(11) NOT NULL AUTO_INCREMENT,
title varchar(255) NOT NULL,
content text NOT NULL,
slug varchar(255) NOT NULL UNIQUE,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS users (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
email varchar(255) NOT NULL UNIQUE,
password varchar(255) NOT NULL,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;