This file contains 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
//Destructing arrays | |
const myArray = [1,2,3,4,5]; | |
const [x,y,z] = myArray; | |
console.log(`${x} ${y} ${z}`); | |
const names = ["Parrot", "Dolpin", "Cat"]; | |
//let name1, name2, name3, name4; | |
let [name1, name2, name3, name4="default"] = names; |
This file contains 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
const div3 = document.getElementById('div3'); | |
const para = div3.querySelector('p'); | |
const textarea = div3.querySelector('textarea'); | |
const paraText = "User is typing"; | |
let timer; | |
textarea.addEventListener("keyup", addText); | |
textarea.addEventListener("keydown", removeText); | |
function addText(e){ |
This file contains 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
const paraText = "User is typing"; | |
let timer; | |
textarea.addEventListener("keyup", addText); | |
textarea.addEventListener("keydown", removeText); | |
function addText(e){ | |
para.innerText = paraText; | |
} | |
function removeText(e){ |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<style> | |
.dummy { | |
color: red; |
This file contains 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
3-33-333" | |
"123-33-333" | |
[object Object] { | |
1: "Chris", | |
age: 17, | |
xRay: "zray" | |
} | |
"Yummy!" | |
"Type: coconut" |
This file contains 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
#This is ecommerce/__init__.py file | |
#If there is a __init__.py in a folder, it makes it a package :) |
This file contains 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
npm version | |
npm config get msvs_version | |
npm config get msvs_version --global | |
npm config set msvs_version 2013 | |
npm config set msvs_version 2013 --global | |
npm i -g npm@latest //Update to the latest version | |
npm run build //refresh typescript |
This file contains 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
public class Solution { | |
private int compx; | |
public int MinDepth(TreeNode root) { | |
compx = 0; | |
if (root is null) | |
return 0; | |
Queue queue = new Queue(); |
This file contains 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
using System; | |
using System.Collections; | |
namespace LongestSubstring | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string input = "abrkaabcdefghijjxxx"; |
This file contains 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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* public int val; | |
* public ListNode next; | |
* public ListNode(int x) { val = x; } | |
* } | |
*/ | |
public class Solution { | |
public void PrintNode(ListNode node) |
NewerOlder