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
a = ['a','b', 'c'] | |
for (let i = 0; i < 3; i++) { | |
var c = a[i]; | |
setTimeout(()=> console.log(c)); // c c c | |
} | |
//is same as, var is function scoped | |
var c; | |
a = ['a','b', 'c'] | |
for (let i = 0; i < 3; i++) { |
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
{ | |
'color': css.color, | |
'font-family': css.fontFamily, | |
'font-size': css.fontSize, | |
'font-style': css.fontStyle, | |
'font-variant': css.fontVariant, | |
'font-weight': css.fontWeight, | |
'letter-spacing': css.letterSpacing, | |
'line-height': css.lineHeight, | |
'text-align':css.textAlign , |
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
console.log($0.offsetWidth) | |
console.log($0.clientWidth) | |
console.log($0.scrollWidth) | |
console.log($0.getBoundingClientRect().width) | |
console.log(getComputedStyle($0).width) | |
console.log($0.clientLeft) | |
console.log($0.offsetLeft) | |
console.log($0.scrollLeft) | |
console.log(innerWidth) | |
console.log(outerWidth) |
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
/** | |
* @param {number[]} nums | |
* @param {number[]} index | |
* @return {number[]} | |
* https://leetcode.com/problems/create-target-array-in-the-given-order/submissions/ | |
*/ | |
function Node(val) { | |
this.val = val; | |
this.next = null; |
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
// Function to encode secret data into image pixels | |
function encodeDataIntoImage(imageData, secretData) { | |
// Assuming imageData is a Uint8ClampedArray representing pixel data of the image | |
// and secretData is the string to be hidden | |
// Convert secretData into binary | |
let binarySecret = secretData.split('').map(char => char.charCodeAt(0).toString(2)).join(''); | |
// Embed binary data into least significant bits of image pixel values | |
for (let i = 0; i < binarySecret.length; i++) { |
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
* { | |
margin: 0; | |
padding: 0; | |
text-rendering: optimizeLegibility; | |
-webkit-font-smoothing: antialiased; | |
} | |
@font-face { | |
font-family: SegoeUI; | |
src: | |
local("Segoe UI Light"), |
OlderNewer