Skip to content

Instantly share code, notes, and snippets.

View Seth-Carter's full-sized avatar

Seth Carter Seth-Carter

View GitHub Profile
function handleBuyButtonClick(event) {
console.log('You clicked a button!');
const button = event.target;
// console.log(button.textContent);
// console.log(parseFloat(event.target.dataset.price));
console.log(event.target);
console.log(event.currentTarget);
console.log(event.target === event.currentTarget);
// Stop this event from bubbling up
// event.stopPropagation();
const getLongestWord = (string) => {
let maxLength = 0;
return Object.entries(string
.replaceAll(/\n/g, ' ')
.split(' ')
.map((word) => {
return word.replaceAll(/[^a-zA-Z]/g, '');
})
.filter(Boolean)
.reduce((hash, word) => {
import random
class PersonNode:
def __init__(self, name=None, eligible_nodes=None, exclusions=None):
self.name = name
self.eligible_nodes = eligible_nodes if eligible_nodes is not None else []
self.exclusions = exclusions if exclusions is not None else set()