for (const [index, value] of ['a', 'b', 'c'].entries()) {
console.log(index, value)
}
/*
0 "a"
1 "b"
Object.prototype.toString.call(true) // [object Boolean]
Object.prototype.toString.call('hello') // [object String]
Object.prototype.toString.call(10) // [object Number]
Object.prototype.toString.call({}) // [object Object]
Object.prototype.toString.call([]) // [object Array]
Object.prototype.toString.call(null) // [object Null]
Object.prototype.toString.call(undefined) // [object Undefined]
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
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
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
CREATE TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |