<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preload" as="image" href="https://bytes.dev/images/bytes-banner-rounded.png">
<link rel="preload" as="image" href="https://bytes.dev/images/content/eyes.png">
<link rel="preload" as="image" href="https://bytes.dev/images/content/dr-evil-pour-one-out.jpg">
<link rel="preload" as="image" href="https://bytes.dev/images/fb-share-icon.png">
<link rel="preload" as="image" href="https://bytes.dev/images/li-share-icon.png">
<link rel="preload" as="image" href="https://bytes.dev/images/tw-share-icon.png">
<link rel="preload" as="image" href="https://bytes.dev/images/em-share-icon.png">
<link rel="preload" as="image" href="https://bytes.dev/images/content/sentry-logo.png">
<link rel="preload" as="image" href="https://bytes.dev/images/content/star-trek-loud-noise.jpg">
<link rel="preload" as="image" href="https://bytes.dev/images/content/spot-the-bug.png">
<link rel="preload" as="image" href="https://bytes.dev/images/content/cool-bits.png">
<link rel="preload" as="image" href="https://bytes.dev/images/bytes-icon.png">
<title>Bytes: Pouring One Out for PHP</title>
<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">
<link href="https://fonts.googleapis.com/css2?family=Fira+Mono&family=Outfit:wght@400;500;700;900&family=Paytone+One" rel="stylesheet">
<style>@media (prefers-color-scheme: dark) {
.email-wrapper {
color: #F9F4DA !important;
background-color: #0F0D0E !important;
}
hr {
border-color: #262422 !important;
}
mark {
background-color: #231F20 !important;
color: #F9F4DA !important;
}
pre {
background-color: #231F20 !important;
border: 1px solid #231F20 !important;
color: #F9F4DA !important;
}
.bg-alt {
background-color: #231F20 !important;
}
.unsubscribe-link {
color: #504C48 !important;
}
.token.punctuation {
color: #f9f4da !important;
}
}
@media screen and (min-width: 600px) {
.mobile-break {
display: none;
}
}</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table class="email-wrapper" border="0" cellspacing="0" width="100%" style="background-color: #FFF; border-collapse: collapse; color: #231F20; font-family: Outfit, sans-serif; font-size: 18px; width: 100%;"><tbody><tr>
<td style="border-collapse: collapse !important; word-break: normal;"></td>
<td width="600px" style="border-collapse: collapse !important; width: 600px; word-break: normal;"><div style="max-width:600px;padding-top:80px">
<div style="text-align:center"><img width="600" style="max-width: 100%; padding-bottom: 40px;" src="https://bytes.dev/images/bytes-banner-rounded.png" alt="Bytes"></div>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;"><strong style="font-weight: 600;">Today’s issue:</strong> Stability in TanTown, the old Chinese proverb about syntax highlighting, and the politically correct way to pronounce “dquickts”.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">Welcome to <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/25h2h9u3x724rdi3h4/aHR0cHM6Ly9ieXRlcy5kZXYvYXJjaGl2ZXMvNTMy" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543307">#532</a>.</p>
<hr style="border: 0; border-bottom: 5px solid; border-color: #f5f5f5; margin-bottom: 100px; margin-top: 100px;">
<div style="text-align:center;margin-bottom:36px">
<img width="80" src="https://bytes.dev/images/content/eyes.png" alt="Eyeballs logo" style="max-width: 100%;"><h2 style="font-family: Paytone One, sans-serif; font-size: 28px; margin-top: 10px; text-transform: uppercase;">The Main Thing</h2>
</div>
<div class="bg-alt" style="background-color: #f5f5f5; border-radius: 16px; margin-bottom: 40px; max-width: 100%; padding: 24px; padding-bottom: 12px;">
<img src="https://bytes.dev/images/content/dr-evil-pour-one-out.jpg" alt="Dr. Evil drinks from a bottle, then pours some out for his homies" width="600" style="border-radius: 5px; max-width: 100%;"><p style="font-family: Outfit, sans-serif; font-size: 17px; font-style: italic; line-height: 1; margin: 0; padding-bottom: 4px; padding-left: 24px; padding-right: 24px; padding-top: 10px; text-align: center;">Remembering our PHP homies in their darkest hour.<!-- --> </p>
</div>
<h3 style="font-size: 24px; margin-bottom: 0; padding-left: 24px; padding-right: 24px;">Pouring One Out for PHP</h3>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">It’s been a rough week for PHP developers, and since there are about 24 loyal Laravel / WordPress devs who read Bytes, we’re dedicating this issue to commiserating with our <code style="font-size: 15px;"><?= brethren ?></code>.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">So what happened? Well, if you don’t know, you probably have healthier internet consumption habits than me, but the TL;DR is that PHP got hacked… badly. The <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/qvh8h8ud38rogqtlhk/aHR0cHM6Ly93d3cud2l6LmlvL2Jsb2cvcGhwMnNoZWxsLXBocC1yY2U=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543308">vulnerabilities are called <code style="font-size: 15px;">php2shell</code></a>, and they can give attackers access to a shell on a vulnerable server, where they could access your database, API keys, and environment variables… or just mine for crypto (if that’s still a thing). Pretty bad, especially considering that the flaws are in PHP itself, putting unpatched servers at risk regardless of the application running on them.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;"><strong style="font-weight: 600;">How does <code style="font-size: 15px;">php2shell</code> work?</strong></p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">First, an attacker sends a <code style="font-size: 15px;">multipart/form-data</code> <code style="font-size: 15px;">POST</code> request to any page on the server, hiding a shell command and the fake data structures needed to execute it in the field values. The request is padded with a huge number of headers and thousands of empty file fields, with <code style="font-size: 15px;">content-length</code> conveniently omitted. PHP runs out of memory while parsing the request, leaving the malicious payload in memory when the shutdown routine runs.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">Then, during shutdown of that same request, the cleanup code walks the half-built state, follows a pointer the attacker planted in it, and executes the payload with the server’s own permissions <span role="img" aria-label="grimacing face">😬</span>.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;"><strong style="font-weight: 600;">What’s the fix?</strong></p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">PHP sites need to update to a patched release: 8.5.12, 8.4.27, 8.3.36, or 8.2.35. Which, if we’re being honest, could be a challenge for sites still running legacy versions. <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/g3hnhwum2e367gurh9/aHR0cHM6Ly9ibG9nLmNsb3VkZmxhcmUuY29tL3BocC12dWxuZXJhYmlsaXRpZXMtd2FmLXByb3RlY3Rpb24=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543309">Cloudflare’s WAF protections</a> can block known exploit attempts while those sites patch, but PHP says updating is the only complete fix.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;"><strong style="font-weight: 600;">Where do we go from here?</strong></p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">While it might be tempting to breathe a sigh of relief, our day of reckoning as JavaScript developers is coming because Node.js just got hit with <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/9qhzhdud8gpzk0s9h3/aHR0cHM6Ly9ub2RlanMub3JnL2VuL2Jsb2cvdnVsbmVyYWJpbGl0eS9vY3RvYmVyLTIwMjYtc2VjdXJpdHktcmVsZWFzZXM=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543310">a high-severity CVE impacting its Brotli decoder</a>. And if I had to guess, this is only the beginning of this new era of software development which is so fun. I love it here.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;"><strong style="font-weight: 600;">Bottom line:</strong> Looks like your PM is going to have to drop all the features they wanted to ship in Q4 in order to keep up with all the security patches coming down the pipe.</p>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse; margin-top: 40px; text-align: center;"><tbody><tr><td style="border-collapse: collapse !important; padding-top: 12px; word-break: normal;">
<a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/3ohphdu38q746msrhn/aHR0cHM6Ly9mYWNlYm9vay5jb20vc2hhcmVyL3NoYXJlci5waHA_dT1odHRwcyUzQSUyRiUyRmJ5dGVzLmRldiUyRmFyY2hpdmVzJTJGNTMy" rel="noopener" style="color: #12b5e5; font-weight: 600; padding-left: 5px; text-decoration: none;" target="_blank" url-id="1897543311"><img alt="" style="display: inline-block; max-width: 100%; width: 32px;" width="25" src="https://bytes.dev/images/fb-share-icon.png"></a><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/n2hohquv4n36w0a6hg/aHR0cHM6Ly93d3cubGlua2VkaW4uY29tL3NoYXJpbmcvc2hhcmUtb2Zmc2l0ZS8_dXJsPWh0dHBzJTNBJTJGJTJGYnl0ZXMuZGV2JTJGYXJjaGl2ZXMlMkY1MzI=" rel="noopener" style="color: #12b5e5; font-weight: 600; padding-left: 5px; text-decoration: none;" target="_blank" url-id="1897543312"><img alt="" style="display: inline-block; max-width: 100%; width: 32px;" width="25" src="https://bytes.dev/images/li-share-icon.png"></a><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/48hvh7um30r6zeuxh7/aHR0cHM6Ly90d2l0dGVyLmNvbS9pbnRlbnQvdHdlZXQvP3RleHQ9U3RhYmlsaXR5JTIwaW4lMjBUYW5Ub3duJTJDJTIwdGhlJTIwb2xkJTIwQ2hpbmVzZSUyMHByb3ZlcmIlMjBhYm91dCUyMHN5bnRheCUyMGhpZ2hsaWdodGluZyUyQyUyMGFuZCUyMHRoZSUyMHBvbGl0aWNhbGx5JTIwY29ycmVjdCUyMHdheSUyMHRvJTIwcHJvbm91bmNlJTIwJUUyJTgwJTlDZHF1aWNrdHMlRTIlODAlOUQuJnVybD1odHRwcyUzQSUyRiUyRmJ5dGVzLmRldiUyRmFyY2hpdmVzJTJGNTMy" rel="noopener" style="color: #12b5e5; font-weight: 600; padding-left: 5px; text-decoration: none;" target="_blank" url-id="1897543313"><img alt="" style="display: inline-block; max-width: 100%; width: 32px;" width="25" src="https://bytes.dev/images/tw-share-icon.png"></a><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/wnh2h6uqdrwx92i7hx/bWFpbHRvOj9zdWJqZWN0PVlvdSUyMGxpa2UlMjBjb3JuYnJlYWQlM0YmYm9keT1UaG91Z2h0JTIweW91JTI3ZCUyMGxvdmUlMjB0aGlzJTIwd2VlayUyN3MlMjBCeXRlcyUwQS0tLSUwQVN0YWJpbGl0eSUyMGluJTIwVGFuVG93biUyQyUyMHRoZSUyMG9sZCUyMENoaW5lc2UlMjBwcm92ZXJiJTIwYWJvdXQlMjBzeW50YXglMjBoaWdobGlnaHRpbmclMkMlMjBhbmQlMjB0aGUlMjBwb2xpdGljYWxseSUyMGNvcnJlY3QlMjB3YXklMjB0byUyMHByb25vdW5jZSUyMCVFMiU4MCU5Q2RxdWlja3RzJUUyJTgwJTlELiUwQWh0dHBzJTNBJTJGJTJGYnl0ZXMuZGV2JTJGYXJjaGl2ZXMlMkY1MzI=" rel="noopener" style="color: #12b5e5; font-weight: 600; padding-left: 5px; text-decoration: none;" target="_blank" url-id="1897543314"><img alt="" style="display: inline-block; max-width: 100%; width: 32px;" width="25" src="https://bytes.dev/images/em-share-icon.png"></a>
</td></tr></tbody></table>
<hr style="border: 0; border-bottom: 5px solid; border-color: #f5f5f5; margin-bottom: 100px; margin-top: 100px;">
<div style="text-align:center;margin-bottom:36px">
<img width="150" src="https://bytes.dev/images/content/sentry-logo.png" alt="Sentry logo" style="max-width: 100%;"><h2 style="font-family: Paytone One, sans-serif; font-size: 28px; margin-top: 10px; text-transform: uppercase;"><span>Our Friends <br class="mobile-break">(With Benefits)</span></h2>
</div>
<div class="bg-alt" style="background-color: #f5f5f5; border-radius: 16px; margin-bottom: 40px; max-width: 100%; padding: 24px; padding-bottom: 12px;">
<img src="https://bytes.dev/images/content/star-trek-loud-noise.jpg" alt="Captain Picard winces with both hands pressed against his ears" width="600" style="border-radius: 5px; max-width: 100%;"><p style="font-family: Outfit, sans-serif; font-size: 17px; font-style: italic; line-height: 1; margin: 0; padding-bottom: 4px; padding-left: 24px; padding-right: 24px; padding-top: 10px; text-align: center;">When you're just trying to find that one customer session but there's too much noise<!-- --> </p>
</div>
<h3 style="font-size: 24px; margin-bottom: 0; padding-left: 24px; padding-right: 24px;"><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/reh8h9umpq0w9gf2h6/aHR0cHM6Ly9zZW50cnkuaW8vcmVzb3VyY2VzLzIwMS1zZXNzaW9uLXJlcGxheXMvP3V0bV9zb3VyY2U9Ynl0ZXMmdXRtX21lZGl1bT1wYWlkLWNvbW11bml0eSZ1dG1fY2FtcGFpZ249cmVwbGF5LWZ5MjdxMy1zZXNzaW9ucmVwbGF5d29ya3Nob3AmdXRtX2NvbnRlbnQ9bmV3c2xldHRlci1wcmltYXJ5LXJlZ2lzdGVy" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543315">The session replays you want without the noise</a></h3>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">Sentry’s session replays are great for seeing exactly what a user experienced during a session, but how do you comb through millions of sessions to get what you need?</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">That’s why Sentry is hosting a <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/reh8h9umpq0w9gf2h6/aHR0cHM6Ly9zZW50cnkuaW8vcmVzb3VyY2VzLzIwMS1zZXNzaW9uLXJlcGxheXMvP3V0bV9zb3VyY2U9Ynl0ZXMmdXRtX21lZGl1bT1wYWlkLWNvbW11bml0eSZ1dG1fY2FtcGFpZ249cmVwbGF5LWZ5MjdxMy1zZXNzaW9ucmVwbGF5d29ya3Nob3AmdXRtX2NvbnRlbnQ9bmV3c2xldHRlci1wcmltYXJ5LXJlZ2lzdGVy" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543315">free workshop</a> on Nov 5 on how to tune your session replay setup.</p>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;"><strong style="font-weight: 600;">You’ll learn about:</strong></p>
<ul>
<li>Sampling and buffering settings</li>
<li>Creating custom hooks to target specific sessions</li>
<li>Capturing user feedback so bug reports get attached to replays</li>
<li>How to set up filters and custom tags that fit your app’s structure</li>
<li>How to keep sensitive data private</li>
</ul>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;"><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/reh8h9umpq0w9gf2h6/aHR0cHM6Ly9zZW50cnkuaW8vcmVzb3VyY2VzLzIwMS1zZXNzaW9uLXJlcGxheXMvP3V0bV9zb3VyY2U9Ynl0ZXMmdXRtX21lZGl1bT1wYWlkLWNvbW11bml0eSZ1dG1fY2FtcGFpZ249cmVwbGF5LWZ5MjdxMy1zZXNzaW9ucmVwbGF5d29ya3Nob3AmdXRtX2NvbnRlbnQ9bmV3c2xldHRlci1wcmltYXJ5LXJlZ2lzdGVy" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543315">Register today for free</a>.</p>
<hr style="border: 0; border-bottom: 5px solid; border-color: #f5f5f5; margin-bottom: 100px; margin-top: 100px;">
<div style="text-align:center;margin-bottom:36px">
<img width="110" src="https://bytes.dev/images/content/spot-the-bug.png" alt="Spot the Bug logo" style="max-width: 100%;"><h2 style="font-family: Paytone One, sans-serif; font-size: 28px; margin-top: 10px; text-transform: uppercase;">Spot the Bug</h2>
<div class="section-presenter" style="margin-bottom:50px;margin-top:15px">
<h4 style="font-size: 20px; margin-bottom: 0; padding-left: 24px; padding-right: 24px;">Spot the Bug – Presented by <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/08hwhgu24mdg0ltlh5/aHR0cHM6Ly9sdW1hLmNvbS9ydW4tYnktYXBpZnk_Y291cG9uPUJZVEVTUlVO" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543316">Run by Apify</a>
</h4>
<p style="font-family: Outfit, sans-serif; font-size: 18px; line-height: 1.5; margin-top: 5px; padding-left: 24px; padding-right: 24px;"><em><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/08hwhgu24mdg0ltlh5/aHR0cHM6Ly9sdW1hLmNvbS9ydW4tYnktYXBpZnk_Y291cG9uPUJZVEVTUlVO" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543316">Run by Apify</a> brings AI agent builders to San Francisco on November 10. Come network, catch live demos, and hear from experts at OpenAI, Stripe, and Coinbase. Use code <code style="font-size: 15px;">BYTESRUN</code> for 50% off your ticket.</em></p>
</div>
</div>
<pre class="language-js" style="-moz-hyphens: none; -moz-tab-size: 2; -ms-hyphens: none; -o-tab-size: 2; -webkit-hyphens: none; background-color: #f9f9f9; border: 1px solid #f9f9f9; border-radius: 8px; box-sizing: border-box; color: #c0c5ce; direction: ltr; font-family: 'Fira Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 15px; hyphens: none; line-height: 1.5; max-width: 100%; overflow: auto; overflow-wrap: anywhere; padding: 24px; tab-size: 2; text-align: left; white-space: pre-wrap; word-spacing: normal;"><code class="language-js" style="-moz-hyphens: none; -moz-tab-size: 2; -ms-hyphens: none; -o-tab-size: 2; -webkit-hyphens: none; color: #c0c5ce; direction: ltr; font-family: 'Fira Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 15px; hyphens: none; line-height: 1.5; overflow-wrap: anywhere; tab-size: 2; text-align: left; white-space: pre-wrap; word-spacing: normal;"><span class="token keyword" style="color: #f38ba3; font-size: 15px;">class</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span> <span class="token punctuation" style="color: #231F20; font-size: 15px;">{</span>
<span class="token function" style="color: #9d7dce; font-size: 15px;">constructor</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token parameter" style="color: #f38ba3; font-size: 15px;">value</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span> <span class="token punctuation" style="color: #231F20; font-size: 15px;">{</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">this</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>value <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> value<span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">this</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">null</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">this</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">null</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token punctuation" style="color: #231F20; font-size: 15px;">}</span>
<span class="token punctuation" style="color: #231F20; font-size: 15px;">}</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">function</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token parameter" style="color: #f38ba3; font-size: 15px;">node</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span> <span class="token punctuation" style="color: #231F20; font-size: 15px;">{</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">let</span> leftDepth <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>node<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">let</span> rightDepth <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>node<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">return</span> Math<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span><span class="token function" style="color: #9d7dce; font-size: 15px;">max</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>leftDepth<span class="token punctuation" style="color: #231F20; font-size: 15px;">,</span> rightDepth<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span> <span class="token operator" style="color: #12b5e5; font-size: 15px;">+</span> <span class="token number" style="color: #fcba28; font-size: 15px;">1</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token punctuation" style="color: #231F20; font-size: 15px;">}</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">let</span> root <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">1</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">2</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">3</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">4</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">5</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
console<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span><span class="token function" style="color: #9d7dce; font-size: 15px;">log</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token string" style="color: #f99157; font-size: 15px;">"Depth of the tree:"</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">,</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>root<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
</code></pre>
<hr style="border: 0; border-bottom: 5px solid; border-color: #f5f5f5; margin-bottom: 100px; margin-top: 100px;">
<div style="text-align:center;margin-bottom:36px">
<img width="110" src="https://bytes.dev/images/content/cool-bits.png" alt="Cool Bits logo" style="max-width: 100%;"><h2 style="font-family: Paytone One, sans-serif; font-size: 28px; margin-top: 10px; text-transform: uppercase;">Cool Bits</h2>
</div>
<ol>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;">We wanted AI to cure cancer, but instead of Light The Night, we got <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/8ghqh3uo8glqe7fkh9/aHR0cHM6Ly9vcGVuYWkuY29tL2luZGV4L2Nvb3JkaW5hdGVkLWRpc2Nsb3N1cmUtb2YtY3JpdGljYWwtdnVsbmVyYWJpbGl0aWVzLw==" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543317">Patch the Planet</a>, an OpenAI initiative to disclose security vulnerabilities to package maintainers before they are announced to the public.</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;"><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/vqh3hmuo6npe26tghl/aHR0cHM6Ly9ibG9nLnNlbnRyeS5pby9hbm90aGVyLXllYXItYW5vdGhlci0xLTAwMC0wMDAtdG8tb3Blbi1zb3VyY2UtbWFpbnRhaW5lcnMv" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543318">Sentry donated <em>one miliiiiiion dollars</em> to open source maintainers this year</a>, which is objectively awesome. I’m glad some people still believe in open source <span role="img" aria-label="pleading face">🥺</span>.</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;">Built an app with Expo? <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/l2heh6ulpo365gc6h0/aHR0cHM6Ly9leHBvLmRldi9hd2FyZHMvMjAyNg==" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543319">Enter it in the Expo App Awards</a> by October 31. Winners get a handcrafted metal cube, a prize you can’t explain to your family but will 100% keep on your desk. [sponsored]</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;">Speaking of paying open source maintainers, <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/m2h7h6u3xo8mgksmhq/aHR0cHM6Ly9vcGVuc291cmNlcGxlZGdlLmNvbS8=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543320">The Open Source Pledge</a> is an initiative to raise funds from companies to support important open source projects. Maybe tell your boss.</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;">The artist formerly known as Framer Motion <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/dphehmuexq0844bmh4/aHR0cHM6Ly9tb3Rpb24uZGV2L2RvY3Mvc2NvcGUtbW90aW9u" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543321">added <code style="font-size: 15px;">scopeMotion</code> and <code style="font-size: 15px;">useScopeMotion</code> in its 14.5 release</a> for easy cleanup, media query matching, setting default transitions, and scoping to an element.</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;"><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/e0hph0u7zk0qplu8h2/aHR0cHM6Ly90YW5zdGFjay5jb20vYmxvZy90YW5zdGFjay1haS0xLTA=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543322">TanStack AI published its first stable release with version 1.0</a>. Lots of stability happening right now in TanTown.</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;"><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/7qh7h2u9e0owk8fzh6/aHR0cHM6Ly9zZXJwYXBpLmNvbS9ieXRlc2Rldi1leHRyYWN0" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543323">SerpApi’s new Extract API</a> lets your agents fetch a public web page and return the whole thing as structured JSON or as clean Markdown. Check out the <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/7qh7h2u9e0owk8fzh6/aHR0cHM6Ly9zZXJwYXBpLmNvbS9ieXRlc2Rldi1leHRyYWN0" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543323">interactive demo</a>. [sponsored]</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;">Colin McDonnell <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/owhkhwuwe4rgklbvhr/aHR0cHM6Ly9yZXlsby5kZXYv" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543324">built a library called Reylo</a> that lets you import <code style="font-size: 15px;">.sql</code> files into TypeScript with full type inference. I think this was the final nail in the coffin for the ORM startup era.</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;">Stencil Labs <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/z2hgh7uezo3p48fph0/aHR0cHM6Ly9naXRodWIuY29tL3N0ZW5jaWwtaHEvZHF1aWNrdHM=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543325">open sourced <code style="font-size: 15px;">dquickts</code></a>, a fork of QuickJS that can natively run TypeScript with a durable execution engine. Can we get Michael Key to teach us all how to pronounce <code style="font-size: 15px;">dquickts</code>?</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;"><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/p8hehqu4e9zg37cqh3/aHR0cHM6Ly93d3cuZ3JlcHRpbGUuY29tLz91dG1fc291cmNlPWJ5dGVzJnV0bV9tZWRpdW09c3BvbnNvcnNoaXAmdXRtX2NhbXBhaWduPWJ5dGVzX29jdDIz" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543326">Greptile built the ultimate AI Code Review tool</a> with AI agent swarms that review and test pull requests with full context of your codebase. [sponsored]</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;"><a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/x0hph3uemnw9rnc5hl/aHR0cHM6Ly93d3cua2ltaS5haS9ibG9nL2tpbWktazMtMS1wcm8=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543327">Kimi K3.1 Pro was just released</a> and it <em>appears</em> to hold its own against Fable, Opus, and Astra on several benchmarks.</p>
</li>
<li>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5;">Shu Ding wrote about <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/6qhehoul4p7nk7cohk/aHR0cHM6Ly9zaHVkLmluL3Rob3VnaHRzL2lkZWFzLWJlaGluZC1ncHUtbGV4ZXI=" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543328">some of the ideas behind his GPU lexer</a>, which is a fancy (but slower than regex) way to do syntax highlighting in the browser. There’s also a Chinese proverb about why throwing bricks is good (unless you live in France, in which case maybe hold on to those bricks).</p>
</li>
</ol>
<hr style="border: 0; border-bottom: 5px solid; border-color: #f5f5f5; margin-bottom: 100px; margin-top: 100px;">
<div style="text-align:center;margin-bottom:36px">
<img width="110" src="https://bytes.dev/images/content/spot-the-bug.png" alt="Spot the Bug logo" style="max-width: 100%;"><h2 style="font-family: Paytone One, sans-serif; font-size: 28px; margin-top: 10px; text-transform: uppercase;">Spot the Bug: Solution</h2>
<div class="section-presenter" style="margin-bottom:50px;margin-top:15px"><h4 style="font-size: 20px; margin-bottom: 0; padding-left: 24px; padding-right: 24px;">Spot the Bug – Presented by <a href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/08hwhgu24mdg0ltlh5/aHR0cHM6Ly9sdW1hLmNvbS9ydW4tYnktYXBpZnk_Y291cG9uPUJZVEVTUlVO" style="color: #12b5e5; font-weight: 600; text-decoration: underline;" url-id="1897543316">Run by Apify</a>
</h4></div>
</div>
<p style="font-family: Outfit, sans-serif; font-size: 19px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">The code will throw a <code style="font-size: 15px;">TypeError</code> because the <code style="font-size: 15px;">treeDepth</code> function is not handling the base case. The base case should be when the <code style="font-size: 15px;">node</code> is <code style="font-size: 15px;">null</code>, in which case the function should return <code style="font-size: 15px;">0</code>.</p>
<pre class="language-js" style="-moz-hyphens: none; -moz-tab-size: 2; -ms-hyphens: none; -o-tab-size: 2; -webkit-hyphens: none; background-color: #f9f9f9; border: 1px solid #f9f9f9; border-radius: 8px; box-sizing: border-box; color: #c0c5ce; direction: ltr; font-family: 'Fira Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 15px; hyphens: none; line-height: 1.5; max-width: 100%; overflow: auto; overflow-wrap: anywhere; padding: 24px; tab-size: 2; text-align: left; white-space: pre-wrap; word-spacing: normal;"><code class="language-js" style="-moz-hyphens: none; -moz-tab-size: 2; -ms-hyphens: none; -o-tab-size: 2; -webkit-hyphens: none; color: #c0c5ce; direction: ltr; font-family: 'Fira Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 15px; hyphens: none; line-height: 1.5; overflow-wrap: anywhere; tab-size: 2; text-align: left; white-space: pre-wrap; word-spacing: normal;"><span class="token keyword" style="color: #f38ba3; font-size: 15px;">class</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span> <span class="token punctuation" style="color: #231F20; font-size: 15px;">{</span>
<span class="token function" style="color: #9d7dce; font-size: 15px;">constructor</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token parameter" style="color: #f38ba3; font-size: 15px;">value</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span> <span class="token punctuation" style="color: #231F20; font-size: 15px;">{</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">this</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>value <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> value<span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">this</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">null</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">this</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">null</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token punctuation" style="color: #231F20; font-size: 15px;">}</span>
<span class="token punctuation" style="color: #231F20; font-size: 15px;">}</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">function</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token parameter" style="color: #f38ba3; font-size: 15px;">node</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span> <span class="token punctuation" style="color: #231F20; font-size: 15px;">{</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">if</span> <span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>node <span class="token operator" style="color: #12b5e5; font-size: 15px;">===</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">null</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">return</span> <span class="token number" style="color: #fcba28; font-size: 15px;">0</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">let</span> leftDepth <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>node<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">let</span> rightDepth <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>node<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">return</span> Math<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span><span class="token function" style="color: #9d7dce; font-size: 15px;">max</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>leftDepth<span class="token punctuation" style="color: #231F20; font-size: 15px;">,</span> rightDepth<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span> <span class="token operator" style="color: #12b5e5; font-size: 15px;">+</span> <span class="token number" style="color: #fcba28; font-size: 15px;">1</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
<span class="token punctuation" style="color: #231F20; font-size: 15px;">}</span>
<span class="token keyword" style="color: #f38ba3; font-size: 15px;">let</span> root <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">1</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">2</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">3</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">4</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
root<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>left<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span>right <span class="token operator" style="color: #12b5e5; font-size: 15px;">=</span> <span class="token keyword" style="color: #f38ba3; font-size: 15px;">new</span> <span class="token class-name" style="color: #12b5e5; font-size: 15px;">TreeNode</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token number" style="color: #fcba28; font-size: 15px;">5</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
console<span class="token punctuation" style="color: #231F20; font-size: 15px;">.</span><span class="token function" style="color: #9d7dce; font-size: 15px;">log</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span><span class="token string" style="color: #f99157; font-size: 15px;">"Depth of the tree:"</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">,</span> <span class="token function" style="color: #9d7dce; font-size: 15px;">treeDepth</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">(</span>root<span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">)</span><span class="token punctuation" style="color: #231F20; font-size: 15px;">;</span>
</code></pre>
<div style="text-align:center;padding-bottom:80px;padding-top:80px">
<div class="bg-alt" style="background-color: #f5f5f5; border-radius: 16px; margin-bottom: 40px; padding: 24px;"><div style="margin-top:-40px">
<img src="https://bytes.dev/images/bytes-icon.png" alt="Bytes" width="55px" style="max-width: 100%; width: 55px;"><h5 style="font-size:18px;font-weight:400;margin-bottom:24px">Want us to say nice things <br> about your company?</h5>
<div style="margin-bottom:16px"><a style="background-color: #FCBA28; border: 1px solid #231F20; border-radius: 100px; color: #231F20; font-size: 14px; font-weight: 600; padding: 8px 14px; text-decoration: none;" href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/kkhmh2unp8l6dnclh7/aHR0cHM6Ly9ieXRlcy5kZXYvYWR2ZXJ0aXNl" url-id="1897543329">Sponsor Bytes</a></div>
<div style="margin-bottom:20px"><a style="color: #FCBA28; font-size: 14px; font-weight: 600; text-decoration: underline;" href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/58hvh8ugw5mkvkh6h4/aHR0cHM6Ly9ieXRlcy5kZXYvc2hhcmU=" url-id="1897543330">or share it</a></div>
<p style="font-family: Outfit, sans-serif; font-size: 14px; line-height: 1.5; padding-left: 24px; padding-right: 24px;">Built with ❤️ by<!-- --> <a style="color: #ed203d; font-weight: 600; text-decoration: underline;" href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/25h2h9u3x724vdb3h4/aHR0cHM6Ly9maXJlc2hpcC5kZXY=" url-id="1897543331">Fireship</a></p>
</div></div>
<p style="font-family: Outfit, sans-serif; font-size: 14px; line-height: 1.5; opacity: 0.5; padding-left: 24px; padding-right: 24px;">50 W Broadway Ste 333 PMB 51647 Salt Lake City, Utah 84101</p>
<div style="font-family:Papyrus, cursive"><a class="unsubscribe-link" href="https://c5e21242.click.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3/qvh8h8ud38ro7qulhk/aHR0cHM6Ly9ieXRlcy5kZXYvdW5zdWJzY3JpYmU=" style="color: #9B9890;" url-id="1897543332">Unsubscribe from Bytes</a></div>
</div>
</div></td>
<td style="border-collapse: collapse !important; word-break: normal;"></td>
</tr></tbody></table>
<span style="display: none"><a href="https://c5e21242.unsubscribe.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3">Unsubscribe</a></span>
<!-- -->
<img src="https://c5e21242.open.convertkit-mail.com/27uepe0gddioh85qk20c3hgg6n0ogfghm2v3" alt="">
</body>
</html>