CINXE.COM
You searched for Javascript | Treehouse Blog
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title> You searched for Javascript | Treehouse Blog </title> <link rel="shortcut icon" href="https://teamtreehouse.com/assets/favicon.png" /> <meta name='robots' content='noindex, follow' /> <style>img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px }</style> <!-- Google Tag Manager for WordPress by gtm4wp.com --> <script data-cfasync="false" data-pagespeed-no-defer> var gtm4wp_datalayer_name = "dataLayer"; var dataLayer = dataLayer || []; </script> <!-- End Google Tag Manager for WordPress by gtm4wp.com --> <!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v24.5) - https://yoast.com/wordpress/plugins/seo/ --> <meta property="og:locale" content="en_US" /> <meta property="og:type" content="article" /> <meta property="og:title" content="You searched for Javascript | Treehouse Blog" /> <meta property="og:url" content="https://blog.teamtreehouse.com/search/Javascript" /> <meta property="og:site_name" content="Treehouse Blog" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:title" content="You searched for Javascript | Treehouse Blog" /> <meta name="twitter:site" content="@treehouse" /> <!-- / Yoast SEO Premium plugin. --> <link rel='dns-prefetch' href='//cdn.fonts.net' /> <link href='https://fonts.gstatic.com' crossorigin rel='preconnect' /> <link rel="alternate" type="application/rss+xml" title="Treehouse Blog » Feed" href="https://blog.teamtreehouse.com/feed" /> <link rel="alternate" type="application/rss+xml" title="Treehouse Blog » Comments Feed" href="https://blog.teamtreehouse.com/comments/feed" /> <link rel="alternate" type="application/rss+xml" title="Treehouse Blog » Search Results for “Javascript” Feed" href="https://blog.teamtreehouse.com/search/Javascript/feed/rss2/" /> <style id='wp-emoji-styles-inline-css' type='text/css'> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 0.07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='wp-block-library-css' href='https://blog.teamtreehouse.com/wp-includes/css/dist/block-library/style.min.css?ver=6.7.1' type='text/css' media='all' /> <style id='classic-theme-styles-inline-css' type='text/css'> /*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} </style> <style id='global-styles-inline-css' type='text/css'> :root{--wp--preset--aspect-ratio--square: 1;--wp--preset--aspect-ratio--4-3: 4/3;--wp--preset--aspect-ratio--3-4: 3/4;--wp--preset--aspect-ratio--3-2: 3/2;--wp--preset--aspect-ratio--2-3: 2/3;--wp--preset--aspect-ratio--16-9: 16/9;--wp--preset--aspect-ratio--9-16: 9/16;--wp--preset--color--black: #000000;--wp--preset--color--cyan-bluish-gray: #abb8c3;--wp--preset--color--white: #ffffff;--wp--preset--color--pale-pink: #f78da7;--wp--preset--color--vivid-red: #cf2e2e;--wp--preset--color--luminous-vivid-orange: #ff6900;--wp--preset--color--luminous-vivid-amber: #fcb900;--wp--preset--color--light-green-cyan: #7bdcb5;--wp--preset--color--vivid-green-cyan: #00d084;--wp--preset--color--pale-cyan-blue: #8ed1fc;--wp--preset--color--vivid-cyan-blue: #0693e3;--wp--preset--color--vivid-purple: #9b51e0;--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple: linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%);--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan: linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%);--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange: linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%);--wp--preset--gradient--luminous-vivid-orange-to-vivid-red: linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%);--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray: linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%);--wp--preset--gradient--cool-to-warm-spectrum: linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%);--wp--preset--gradient--blush-light-purple: linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%);--wp--preset--gradient--blush-bordeaux: linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%);--wp--preset--gradient--luminous-dusk: linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%);--wp--preset--gradient--pale-ocean: linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%);--wp--preset--gradient--electric-grass: linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%);--wp--preset--gradient--midnight: linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%);--wp--preset--font-size--small: 13px;--wp--preset--font-size--medium: 20px;--wp--preset--font-size--large: 36px;--wp--preset--font-size--x-large: 42px;--wp--preset--spacing--20: 0.44rem;--wp--preset--spacing--30: 0.67rem;--wp--preset--spacing--40: 1rem;--wp--preset--spacing--50: 1.5rem;--wp--preset--spacing--60: 2.25rem;--wp--preset--spacing--70: 3.38rem;--wp--preset--spacing--80: 5.06rem;--wp--preset--shadow--natural: 6px 6px 9px rgba(0, 0, 0, 0.2);--wp--preset--shadow--deep: 12px 12px 50px rgba(0, 0, 0, 0.4);--wp--preset--shadow--sharp: 6px 6px 0px rgba(0, 0, 0, 0.2);--wp--preset--shadow--outlined: 6px 6px 0px -3px rgba(255, 255, 255, 1), 6px 6px rgba(0, 0, 0, 1);--wp--preset--shadow--crisp: 6px 6px 0px rgba(0, 0, 0, 1);}:where(.is-layout-flex){gap: 0.5em;}:where(.is-layout-grid){gap: 0.5em;}body .is-layout-flex{display: flex;}.is-layout-flex{flex-wrap: wrap;align-items: center;}.is-layout-flex > :is(*, div){margin: 0;}body .is-layout-grid{display: grid;}.is-layout-grid > :is(*, div){margin: 0;}:where(.wp-block-columns.is-layout-flex){gap: 2em;}:where(.wp-block-columns.is-layout-grid){gap: 2em;}:where(.wp-block-post-template.is-layout-flex){gap: 1.25em;}:where(.wp-block-post-template.is-layout-grid){gap: 1.25em;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-color{color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-color{color: var(--wp--preset--color--white) !important;}.has-pale-pink-color{color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-color{color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-color{color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-color{color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-color{color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-color{color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-color{color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-color{color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-color{color: var(--wp--preset--color--vivid-purple) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-background-color{background-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-pale-pink-background-color{background-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-background-color{background-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-background-color{background-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-background-color{background-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-background-color{background-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-background-color{background-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-background-color{background-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-background-color{background-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-background-color{background-color: var(--wp--preset--color--vivid-purple) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-border-color{border-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-pale-pink-border-color{border-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-border-color{border-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-border-color{border-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-border-color{border-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-border-color{border-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-border-color{border-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-border-color{border-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-border-color{border-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-border-color{border-color: var(--wp--preset--color--vivid-purple) !important;}.has-vivid-cyan-blue-to-vivid-purple-gradient-background{background: var(--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple) !important;}.has-light-green-cyan-to-vivid-green-cyan-gradient-background{background: var(--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan) !important;}.has-luminous-vivid-amber-to-luminous-vivid-orange-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange) !important;}.has-luminous-vivid-orange-to-vivid-red-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-orange-to-vivid-red) !important;}.has-very-light-gray-to-cyan-bluish-gray-gradient-background{background: var(--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray) !important;}.has-cool-to-warm-spectrum-gradient-background{background: var(--wp--preset--gradient--cool-to-warm-spectrum) !important;}.has-blush-light-purple-gradient-background{background: var(--wp--preset--gradient--blush-light-purple) !important;}.has-blush-bordeaux-gradient-background{background: var(--wp--preset--gradient--blush-bordeaux) !important;}.has-luminous-dusk-gradient-background{background: var(--wp--preset--gradient--luminous-dusk) !important;}.has-pale-ocean-gradient-background{background: var(--wp--preset--gradient--pale-ocean) !important;}.has-electric-grass-gradient-background{background: var(--wp--preset--gradient--electric-grass) !important;}.has-midnight-gradient-background{background: var(--wp--preset--gradient--midnight) !important;}.has-small-font-size{font-size: var(--wp--preset--font-size--small) !important;}.has-medium-font-size{font-size: var(--wp--preset--font-size--medium) !important;}.has-large-font-size{font-size: var(--wp--preset--font-size--large) !important;}.has-x-large-font-size{font-size: var(--wp--preset--font-size--x-large) !important;} :where(.wp-block-post-template.is-layout-flex){gap: 1.25em;}:where(.wp-block-post-template.is-layout-grid){gap: 1.25em;} :where(.wp-block-columns.is-layout-flex){gap: 2em;}:where(.wp-block-columns.is-layout-grid){gap: 2em;} :root :where(.wp-block-pullquote){font-size: 1.5em;line-height: 1.6;} </style> <link rel='stylesheet' id='toc-screen-css' href='https://blog.teamtreehouse.com/wp-content/plugins/table-of-contents-plus/screen.min.css?ver=2411.1' type='text/css' media='all' /> <link rel='stylesheet' id='ppress-frontend-css' href='https://blog.teamtreehouse.com/wp-content/plugins/wp-user-avatar/assets/css/frontend.min.css?ver=4.15.21' type='text/css' media='all' /> <link rel='stylesheet' id='ppress-flatpickr-css' href='https://blog.teamtreehouse.com/wp-content/plugins/wp-user-avatar/assets/flatpickr/flatpickr.min.css?ver=4.15.21' type='text/css' media='all' /> <link rel='stylesheet' id='ppress-select2-css' href='https://blog.teamtreehouse.com/wp-content/plugins/wp-user-avatar/assets/select2/select2.min.css?ver=6.7.1' type='text/css' media='all' /> <link rel='stylesheet' id='font-css' href='//cdn.fonts.net/kit/39d0ab8f-c2d6-48ee-8a04-732fec352d95/39d0ab8f-c2d6-48ee-8a04-732fec352d95.css?ver=6.7.1' type='text/css' media='all' /> <link rel='stylesheet' id='custom-css' href='https://blog.teamtreehouse.com/wp-content/themes/treehouse-blog-reboot/css/all.css?ver=6.7.1' type='text/css' media='all' /> <style id='akismet-widget-style-inline-css' type='text/css'> .a-stats { --akismet-color-mid-green: #357b49; --akismet-color-white: #fff; --akismet-color-light-grey: #f6f7f7; max-width: 350px; width: auto; } .a-stats * { all: unset; box-sizing: border-box; } .a-stats strong { font-weight: 600; } .a-stats a.a-stats__link, .a-stats a.a-stats__link:visited, .a-stats a.a-stats__link:active { background: var(--akismet-color-mid-green); border: none; box-shadow: none; border-radius: 8px; color: var(--akismet-color-white); cursor: pointer; display: block; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif; font-weight: 500; padding: 12px; text-align: center; text-decoration: none; transition: all 0.2s ease; } /* Extra specificity to deal with TwentyTwentyOne focus style */ .widget .a-stats a.a-stats__link:focus { background: var(--akismet-color-mid-green); color: var(--akismet-color-white); text-decoration: none; } .a-stats a.a-stats__link:hover { filter: brightness(110%); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.16); } .a-stats .count { color: var(--akismet-color-white); display: block; font-size: 1.5em; line-height: 1.4; padding: 0 13px; white-space: nowrap; } </style> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-includes/js/jquery/jquery.min.js?ver=3.7.1" id="jquery-core-js"></script> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1" id="jquery-migrate-js"></script> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-content/plugins/wp-user-avatar/assets/flatpickr/flatpickr.min.js?ver=4.15.21" id="ppress-flatpickr-js"></script> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-content/plugins/wp-user-avatar/assets/select2/select2.min.js?ver=4.15.21" id="ppress-select2-js"></script> <script type="text/javascript"> !function(){var analytics=window.analytics=window.analytics||[];if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.0"; window.analytics.load("DMUKccVYvuuUIVSJlokCJe0YQyGm9qVb"); window.analytics.page(); }}(); </script> <link rel="https://api.w.org/" href="https://blog.teamtreehouse.com/wp-json/" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://blog.teamtreehouse.com/xmlrpc.php?rsd" /> <!-- Google Tag Manager for WordPress by gtm4wp.com --> <!-- GTM Container placement set to automatic --> <script data-cfasync="false" data-pagespeed-no-defer> var dataLayer_content = {"pagePostType":"search-results","siteSearchTerm":"Javascript","siteSearchFrom":"","siteSearchResults":12}; dataLayer.push( dataLayer_content ); </script> <script data-cfasync="false"> (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-PZ55S7'); </script> <!-- End Google Tag Manager for WordPress by gtm4wp.com --><!-- There is no amphtml version available for this URL. --><link rel="icon" href="https://blog.teamtreehouse.com/wp-content/uploads/2018/08/favicon.png" sizes="32x32" /> <link rel="icon" href="https://blog.teamtreehouse.com/wp-content/uploads/2018/08/favicon.png" sizes="192x192" /> <link rel="apple-touch-icon" href="https://blog.teamtreehouse.com/wp-content/uploads/2018/08/favicon.png" /> <meta name="msapplication-TileImage" content="https://blog.teamtreehouse.com/wp-content/uploads/2018/08/favicon.png" /> <style type="text/css" id="wp-custom-css"> .blog-post { margin: 0 !important; width: inherit; } .blog-comments { margin: 0 !important; width: inherit; } .techdegree-cta-generic-wrapper { max-width: 984px; /*height: 294px;*/ display: flex; align-items: center; margin: 50px auto; } .techdegree-cta-generic-container-right img { max-width: 255px !important; max-height: 255px !important; border: none !important; } .techdegree-cta-generic-container-right-v2 img { border: none !important; } .techdegree-cta-generic-container-left { padding-left: 20px; width: 57% } .techdegree-cta-generic-text-heading { margin: 0; color: #fff; font-size: 30px !important; line-height: 30px; } .techdegree-cta-generic-text { font-size: 16px; font-weight: 500; line-height: 19px; color: #fff; } .techdegree-cta-button { background: #fff; width: 231px; height: 49px; border: none; line-height: 29px; font-size: 19px; font-weight: 500; } .topic-javascript { color: #133EA2; } .topic-javascript:hover { background: #133EA2; color: #fff !important; } .topic-design { color: #4A4290; } .topic-design:hover { background: #4A4290; color: #fff !important; } .topic-python { color: #0E8397; } .topic-python:hover { background: #0E8397; color: #fff !important; } .topic-data { color: #944F81; } .topic-data:hover { background: #944F81; color: #fff !important; } .topic-python { color: #0E8397; } .topic-python:hover { background: #0E8397; color: #fff !important; } @media screen and (max-width: 1130px) { .techdegree-cta-generic-wrapper { height: 219px; } .techdegree-cta-generic-text-heading { width: 65% !important; margin: 0 auto; font-size: 16px !important; line-height: 19.2px; } .techdegree-cta-generic-text { width: 70%; margin: 15px auto; font-size: 10px; line-height: 12px; } .techdegree-cta-generic-container-right { display: none; } .techdegree-cta-generic-container-right-v2 { display: none; } .techdegree-cta-generic-container-left { width: 100%; padding-left: 0; text-align: center; } .techdegree-cta-button { height: 32px; width: 157px; font-size: 12px; line-height: 13.46px; } } /* Image borders - remove */ img[class*="align"], img[class*="wp-image-"], #content .gallery .gallery-icon img { border: none; } @media screen and (max-width: 400px) { .techdegree-cta-generic-text { width: 75%; } } .wp-block-image :where(figcaption) { text-align: center; font-size: 16px; } </style> <script>var $ = jQuery.noConflict();</script> <!-- OneTrust Cookies Consent Notice (Production Standard, teamtreehouse.com, en-GB) start --> <script src="https://optanon.blob.core.windows.net/consent/39d1ae64-085b-42e6-a239-a988d6530b80.js" type="text/javascript" charset="UTF-8"></script> <script type="text/javascript"> function OptanonWrapper() { window.dataLayer.push({ event: "OneTrustGroupsUpdated" }) } </script> <!-- OneTrust Cookies Consent Notice (Production Standard, teamtreehouse.com, en-GB) end --> <script type="text/plain" class="optanon-category-3"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-25670760-10']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script type="text/plain" class="optanon-category-4"> /* <![CDATA[ */ var google_conversion_id = 1017883234; var google_conversion_label = "hbMzCI7rvAMQ4tSu5QM"; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]> */ </script> <script src="//www.googleadservices.com/pagead/conversion.js" type="text/plain" class="optanon-category-4"> // here ends google retargeting </script> <!-- Start Eloqua alena --> <script type="text/javascript"> window._elqQ = []; function _elqInitialize() { if(!window._elqInitialized) { window._elqInitialized = true; _elqQ.push(['elqSetSiteId', '1855842777']); var s = document.createElement('script'); s.type = 'text/javascript'; s.src = '//img04.en25.com/i/elqCfg.min.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } }; </script> <script type="text/plain" class="optanon-category-2"> _elqInitialize(); </script> <script type="text/plain" class="optanon-category-4"> _elqInitialize(); _elqQ.push(['elqTrackPageView']); </script> </head> <body class="search search-results"> <!-- GTM Container placement set to automatic --> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PZ55S7" height="0" width="0" style="display:none;visibility:hidden" aria-hidden="true"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <nav> <section> <a href="https://teamtreehouse.com" class="brand"> <svg class="treehouse-icon" viewBox="0 0 139 32" preserveAspectRatio="xMinYMin meet"> <g> <path class="icon-treehouse" d="M42.8,21c-0.4,0.1-0.9,0.2-1.4,0.2c-1,0-1.4-0.6-1.4-1.6v-4.5h2.8c0.7,0,1.4-0.5,1.4-1.3s-0.6-1.3-1.4-1.3 H40V11c0-0.9-0.7-1.5-1.5-1.5S37,10.2,37,11v8.7c0,2.5,1.2,4.3,4,4.3c0.8,0,1.9-0.1,2.7-0.5c0.7-0.3,0.9-0.8,0.9-1.3 C44.6,21.5,43.9,20.8,42.8,21z M52.8,12.1c-0.4-0.1-1.2-0.2-1.9-0.2c-2.5,0-3.9,1.5-3.9,3.8v6.8c0,0.8,0.7,1.5,1.5,1.5 s1.5-0.7,1.5-1.5v-6.2c0-1,0.4-1.4,1.1-1.4c0.7,0,1.1,0.2,1.7,0.2c0.9,0,1.4-0.8,1.4-1.4C54.1,12.9,53.7,12.4,52.8,12.1z M61.1,11.9 c-2.8,0-4.8,1.8-5.1,4.7c0,0.7-0.1,1.9,0,2.8c0.2,2.8,2.2,4.7,5.2,4.7c1.4,0,2.7-0.3,3.5-0.8c0.6-0.4,0.7-0.8,0.7-1.2 c0-0.8-0.7-1.6-1.9-1.2c-0.7,0.3-1.5,0.5-2.3,0.5c-1.4,0-2.5-0.7-2.5-2.1V19h5.7c1,0,1.5-0.6,1.5-1.5V17C66,13.9,64,11.9,61.1,11.9z M63,17h-4.2c0-1.5,0.7-2.5,2.3-2.5c1.4,0,2.2,0.9,2.1,2.2C63.2,16.9,63.2,17,63,17z M73.1,11.9c-2.8,0-4.8,1.8-5.1,4.7 c0,0.7-0.1,1.9,0,2.8c0.2,2.8,2.2,4.7,5.2,4.7c1.4,0,2.7-0.3,3.5-0.8c0.6-0.4,0.7-0.8,0.7-1.2c0-0.8-0.7-1.6-1.9-1.2 c-0.7,0.3-1.5,0.5-2.3,0.5c-1.4,0-2.5-0.7-2.5-2.1V19h5.7c1,0,1.5-0.6,1.5-1.5V17C78,13.9,76,11.9,73.1,11.9z M75,17h-4.2 c0-1.5,0.7-2.5,2.3-2.5c1.4,0,2.2,0.9,2.1,2.2C75.2,16.9,75.2,17,75,17z M123.6,16.9l-1.6-0.4c-1-0.2-1.3-0.5-1.3-1s0.5-0.9,1.6-0.9 c0.6,0,1.3,0.2,1.9,0.5c0.7,0.4,1.5,0.3,1.9-0.2c0.5-0.5,0.5-1.4-0.1-2c-0.8-0.6-2.2-1-3.6-1c-2.6,0-4.5,1.3-4.5,3.7 c0,1.9,1.4,2.9,3.2,3.4c0.9,0.2,0.8,0.2,1.6,0.4c0.9,0.2,1.3,0.6,1.3,1c0,0.6-0.5,1-1.7,1c-1,0-1.9-0.3-2.6-0.7 c-0.7-0.5-1.5-0.3-1.9,0.3c-0.4,0.6-0.3,1.4,0.3,1.8c0.8,0.7,2.1,1.3,4.2,1.3c2.6,0,4.6-1.4,4.6-3.8 C126.9,18.5,125.8,17.4,123.6,16.9z M137.5,19c1,0,1.5-0.6,1.5-1.5l0,0V17c0-3.1-2-5.1-4.9-5.1c-2.8,0-4.8,1.8-5.1,4.7 c0,0.7-0.1,1.9,0,2.8c0.2,2.8,2.2,4.7,5.2,4.7c1.4,0,2.7-0.3,3.5-0.8c0.6-0.4,0.7-0.8,0.7-1.2c0-0.8-0.7-1.6-1.9-1.2 c-0.7,0.3-1.5,0.5-2.3,0.5c-1.4,0-2.5-0.7-2.5-2.1V19H137.5z M134.1,14.5c1.4,0,2.2,0.9,2.1,2.2c0,0.2-0.1,0.3-0.2,0.3h-4.2 C131.8,15.5,132.6,14.5,134.1,14.5z M97.5,11.9c-3,0-5.2,1.9-5.5,4.5c-0.1,0.9-0.1,2.3,0,3.2c0.2,2.6,2.5,4.5,5.5,4.5 s5.2-1.9,5.4-4.5c0.1-0.9,0.1-2.2,0-3.1C102.7,13.8,100.5,11.9,97.5,11.9z M99.9,19.1c-0.1,1.3-1,2.1-2.4,2.1s-2.3-0.9-2.4-2.1 c0-0.6,0-1.6,0-2.2c0.1-1.3,1-2.1,2.4-2.1s2.3,0.9,2.4,2.1C100,17.5,100,18.5,99.9,19.1z M85.6,11.9c-1.1,0-2.3,0.4-2.7,0.9l0,0V9.6 c0-0.9-0.6-1.5-1.4-1.5s-1.4,0.7-1.4,1.5v12.9c0,0.8,0.7,1.5,1.5,1.5s1.4-0.7,1.4-1.5v-6.7c0.5-0.5,1.3-0.9,2.3-0.9 c1.2,0,1.9,0.7,1.9,2.1v5.5c0,0.9,0.6,1.6,1.4,1.6c0.9,0,1.5-0.7,1.5-1.6v-5.7C90,13.6,88.4,11.9,85.6,11.9z M113.6,12 c-0.8,0-1.5,0.7-1.5,1.5v7.1c-0.5,0.3-1.2,0.6-2.1,0.6c-1.2,0-2.1-0.7-2.1-2.1v-5.6c0-0.9-0.7-1.6-1.5-1.6c-0.9,0-1.4,0.7-1.4,1.6 v5.7c0,3.1,1.8,4.8,4.9,4.8c2.3,0,3.9-0.8,4.6-1.3c0.4-0.2,0.5-0.5,0.5-1v-8.2C115,12.7,114.4,12,113.6,12z"/> <path class="icon-logo" d="M28.4,7c-0.4-0.2-1.3-0.6-2.3-1.2c-1.1-0.6-2.8,0.4-3.9,2.1l-1.9,3.2c-0.7,1.4-0.6,2.9,0.3,4.2l0.1,0.1 c0.9,1.3,2.1,2.4,2.4,2.8c0.2,0.2,0.4,0.6,0.5,0.9c0.3,1.2-0.3,2.3-1.5,2.6c-1.1,0.3-2.3-0.4-2.7-1.5c-0.1-0.3-0.1-0.6-0.1-0.9 c0.1-0.5-0.1-1.3-0.8-1.9c-0.7-0.8-2.1,0.7-2.5,2.1v0.1c-0.4,1.5-0.7,2.7-0.6,2.8c0,0.1,0.1,0.2,0.1,0.2c0.6,1.2,0.2,2.6-1,3.2 s-2.7,0.2-3.3-1s-0.2-2.6,1-3.2c0.1,0,0.1-0.1,0.2-0.1c0.1,0,0.3-0.7,0.6-1.4c0.2-0.7,0.4-1.3,0.4-1.3c0-0.1,0-0.2,0.1-0.2l1.2-4.2 l-1.2,2.5c-0.2-0.5-0.4-0.5-1-0.1c-0.3,0.2-0.9,0.7-1.1,0.9c-0.5,0.4-0.9,1.1-1.1,1.5c-0.1,0.3-0.3,0.5-0.5,0.7 c-0.9,0.8-2.3,0.6-3-0.3s-0.5-2.1,0.4-2.8c0.3-0.2,0.6-0.4,0.9-0.4c0.5-0.1,2.4-1.3,3.5-2c0.2-0.1,0.4-0.3,0.5-0.4l2.9-2.1l-2.6,1.4 c0,0-0.3,0-0.6,0c-0.8,0.1-1.8,0.2-2,0.5c-0.1,0.1-0.2,0.3-0.4,0.4c-0.8,0.4-2,0.2-2.7-0.6c-0.6-0.9-0.4-2,0.4-2.6 c0.5-0.3,0.9-0.4,1.3-0.4c0.7,0,2.5,0.4,4,0.1l0.4-0.1c1.5-0.3,3.3-1.5,4-2.9c0,0,0.7-1.3,1.6-2.7c0.9-1.5,0.8-3.1-0.1-3.7l-1.7-1 c-0.9-0.5-2.3-0.5-3.2,0L1.6,6.8C0.7,7.3,0,8.6,0,9.6v12.8c0,1,0.7,2.1,1.6,2.6l11.9,6.6c0.9,0.5,2.3,0.5,3.2,0l11.7-6.7 c0.9-0.5,1.6-1.6,1.6-2.6V9.6C30,8.6,29.3,7.5,28.4,7z"/> </g> </svg> </a> <div id="mobile-nav-toggle"> <a href="#" id="nav-toggle" data-nav-toggle> <span class="hamburger"></span> </a> </div> <a class="fixed-cta" href="https://teamtreehouse.com/subscribe/plans?trial=yes&cid=3842">Learn to code.<span> Start your free trial with Treehouse.</span></a> <ul class="nav-list"> <li class="nav-item "> <a href="https://blog.teamtreehouse.com/search" class="nav-anchor search"> <svg viewBox="0 0 24 24" preserveAspectRatio="xMinYMin meet"> <path id="XMLID_3_" fill="none" d="M15.8,9.2C15.8,5.8,13,3,9.6,3C6.1,3,3.4,5.8,3.4,9.2c0,3.4,2.8,6.2,6.2,6.2 C13,15.4,15.8,12.6,15.8,9.2z"/> <path id="XMLID_10_" d="M23.2,21.4L16.7,15c1.3-1.6,2-3.6,2-5.8c0-5.1-4.1-9.2-9.2-9.2C4.5,0,0.4,4.1,0.4,9.2 c0,5.1,4.1,9.2,9.2,9.2c1.8,0,3.5-0.5,4.9-1.4l6.6,6.6c0.3,0.3,0.7,0.4,1.1,0.4s0.8-0.1,1.1-0.4C23.8,23,23.8,22,23.2,21.4z M3.4,9.2C3.4,5.8,6.1,3,9.6,3c3.4,0,6.2,2.8,6.2,6.2c0,3.4-2.8,6.2-6.2,6.2C6.1,15.4,3.4,12.6,3.4,9.2z"/> </svg> </a> </li> <li class="nav-item "> <a href="https://blog.teamtreehouse.com" class="nav-anchor">Home</a> </li> <li class="nav-item nav-item-free-trial"> <a href="https://teamtreehouse.com/subscribe/plans?trial=yes&cid=3842" class="nav-anchor">Free trial</a> </li> </ul> </section> </nav> <!-- Admin Nav --> <div class="page-container"> <header> <section> <h1>Search</h1> </section> </header> <section class="search-header"> <div class="row"> <h2>We found <span>357</span> results with the keyword <span>Javascript</span> in it.</h2> </div> </section> <section class="page-content"> <div class="row flex-grid"> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/javascript-fetch-api-retrieving-data-from-servers" class="post-31387 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-javascript tag-learn-programming tag-learn-to-code"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2024/04/dynamically-change-values-in-javascript.png);"class="featured-image has-image-bg post-31387 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-javascript tag-learn-programming tag-learn-to-code"></div> <div class="copy"> <p class="category">April 14, 2024 in Learn</p> <h3>JavaScript Fetch API: Retrieving Data from Servers</h3> <div class="excerpt"> <p>If you’re an aspiring JavaScript developer looking to harness the power of modern web programming, understanding the Fetch API is a crucial part of building robust, data-rich applications. In this post, I’ll introduce you to how to use the JavaScript…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/dynamically-change-values-in-javascript" class="post-31367 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-javascript tag-learn-programming tag-learn-to-code"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2024/03/Screenshot_2024-03-11_at_3.45.29_PM.png);"class="featured-image has-image-bg post-31367 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-javascript tag-learn-programming tag-learn-to-code"></div> <div class="copy"> <p class="category">March 12, 2024 in Learn</p> <h3>Dynamically Change Values in JavaScript</h3> <div class="excerpt"> <p>Things on the internet are always changing. Sometimes websites themselves change. Sometimes things on a website dynamically change while you鈥檙e interacting with it. This is where my interest peaks. That’s why I want to discuss how to dynamically change values…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/manipulating-classes-using-classlist-api" class="post-22863 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-class tag-classlist tag-code tag-html5 tag-javascript tag-learn-programming"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2013/11/logo-design-101.png);"class="featured-image has-image-bg post-22863 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-class tag-classlist tag-code tag-html5 tag-javascript tag-learn-programming"></div> <div class="copy"> <p class="category">February 8, 2023 in Learn</p> <h3>How to Manipulate Classes Using the JavaScript classList API</h3> <div class="excerpt"> <p>Something that comes up often when building front-end web applications is the need to change the classes applied to an element. For some time elements have had a className attribute which allows you to retrieve a string containing the class…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/what-is-javascript" class="post-30745 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-javascript tag-learn-programming tag-learn-to-code"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2021/06/Screen-Shot-2021-06-22-at-11.50.43-AM.png);"class="featured-image has-image-bg post-30745 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-javascript tag-learn-programming tag-learn-to-code"></div> <div class="copy"> <p class="category">December 15, 2022 in Learn</p> <h3>What is JavaScript?</h3> <div class="excerpt"> <p>This blog post was written by chatGPT. The Treehouse team is experimenting with this exciting new service and so thought we would ask it a few questions and see how it compares to similar content! If you’re wondering what is…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/javascript-array-methods-reduce" class="post-30734 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2022/12/Frame-73.png);"class="featured-image has-image-bg post-30734 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"></div> <div class="copy"> <p class="category">December 13, 2022 in Learn</p> <h3>JavaScript Array Methods: reduce()</h3> <div class="excerpt"> <p>The reduce() method in JavaScript is used to apply a function to each element in an array, with the purpose of reducing the array to a single value. This method is often used for tasks such as summing the elements…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/javascript-array-methods-includes" class="post-30731 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2022/12/Frame-74.png);"class="featured-image has-image-bg post-30731 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"></div> <div class="copy"> <p class="category">December 13, 2022 in Learn</p> <h3>JavaScript Array Methods: includes()</h3> <div class="excerpt"> <p>Ever wondered if an array included a specific value? There is an easy way to check this by using a JavaScript array method known as includes(). Follow along as I go over this method and show you how to use…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/javascript-array-methods-sort" class="post-30728 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2022/12/Frame-75.png);"class="featured-image has-image-bg post-30728 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"></div> <div class="copy"> <p class="category">December 9, 2022 in Learn</p> <h3>JavaScript Array Methods: sort()</h3> <div class="excerpt"> <p>Ever found yourself needing to sort an array? This could be strings being sorted in alphabetical order or even a players’ scores from highest to lowest. Whichever the case may be, the JavaScript sort() method can make this task easy….</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/javascript-array-methods-find" class="post-30725 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2022/12/find.png);"class="featured-image has-image-bg post-30725 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"></div> <div class="copy"> <p class="category">December 6, 2022 in Learn</p> <h3>JavaScript Array Methods: find()</h3> <div class="excerpt"> <p>Ever needed to find or locate a specific array item? Luckily for us, we have a JavaScript method that can handle that task with ease. In this quick guide, I’ll go over the find() JavaScript array method. If you’re ready,…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/difference-between-java-vs-javascript" class="post-30712 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2022/08/javascript-search_blog.png);"class="featured-image has-image-bg post-30712 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"></div> <div class="copy"> <p class="category">December 2, 2022 in Learn</p> <h3>Java vs. JavaScript: A Complete Comparison</h3> <div class="excerpt"> <p>The programming languages Java and JavaScript may sound similar, but they鈥檙e not actually related to each other at all. In fact, it鈥檚 often said that the name ‘JavaScript’ was a marketing tactic to take advantage of Java’s popularity. Although both…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/php-vs-javascript" class="post-30695 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2022/08/javascript-search_blog.png);"class="featured-image has-image-bg post-30695 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"></div> <div class="copy"> <p class="category">November 28, 2022 in Learn</p> <h3>PHP vs. JavaScript: Comparisons and Applications</h3> <div class="excerpt"> <p>PHP and JavaScript are two very popular programming languages and there are many web apps that use them both at the same time. The main difference is that, while PHP is only for back-end development, JavaScript is used for front-…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/storing-data-on-the-client-with-localstorage" class="post-20947 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-code tag-html5 tag-javascript tag-learn-programming tag-localstorage tag-make-a-website tag-sessionstorage tag-web-app"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2013/01/localstorage-feature.png);"class="featured-image has-image-bg post-20947 post type-post status-publish format-standard has-post-thumbnail hentry category-learn tag-code tag-html5 tag-javascript tag-learn-programming tag-localstorage tag-make-a-website tag-sessionstorage tag-web-app"></div> <div class="copy"> <p class="category">November 25, 2022 in Learn</p> <h3>How to Store Data in LocalStorage in JavaScript</h3> <div class="excerpt"> <p>The LocalStorage API gives front-end web developers access to a simple key-value datastore that can be used to save data on a user’s computer. Saving data on the client side can help speed up the performance of your web applications…</p> </div> </div> </a> </article> <article class="excerpt"> <a href="https://blog.teamtreehouse.com/javascript-array-methods-filter" class="post-30683 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"> <div style="background-image: url(https://blog.teamtreehouse.com/wp-content/uploads/2022/11/filterpng.png);"class="featured-image has-image-bg post-30683 post type-post status-publish format-standard has-post-thumbnail hentry category-learn"></div> <div class="copy"> <p class="category">November 21, 2022 in Learn</p> <h3>JavaScript Array Methods: filter()</h3> <div class="excerpt"> <p>Ever needed to filter array elements? Luckily for you there is an easy way to do this in javascript by using the filter() array method. Let’s dive into how we can use this method and what it can do. Consider…</p> </div> </div> </a> </article> </div> </section> <section class="pagination"> <div class="row"> <span aria-current="page" class="page-numbers current">1</span> <a class="page-numbers" href="https://blog.teamtreehouse.com/page/2?s=Javascript">2</a> <a class="page-numbers" href="https://blog.teamtreehouse.com/page/3?s=Javascript">3</a> <span class="page-numbers dots">…</span> <a class="page-numbers" href="https://blog.teamtreehouse.com/page/30?s=Javascript">30</a> <a class="next page-numbers" href="https://blog.teamtreehouse.com/page/2?s=Javascript">Next</a> </div> </section> <section> <footer id="footer"> <div class="treehouse-typelockup"></div> <p> ©2025 Treehouse Island, Inc. <br> <br> <a href="https://teamtreehouse.com/about">About</a> • <a href="https://teamtreehouse.com/jobs">Careers</a> • <a href="https://blog.teamtreehouse.com">Blog</a> • <a href="https://teamtreehouse.com/affiliate-program">Affiliate Program</a> • <a href="https://teamtreehouse.com/terms">Terms</a> • <a href="https://teamtreehouse.com/privacy">Privacy</a> • <a href="https://teamtreehouse.com/support">Contact</a> </p> <ul class="social"> <li><a href="https://twitter.com/treehouse" class="twitter"></a></li> <li><a href="https://youtube.com/gotreehouse" class="youtube"></a></li> <li><a href="https://facebook.com/teamtreehouse" class="facebook"></a></li> <li><a href="https://linkedin.com/company/treehouse-island-inc-" class="linkedin"></a></li> <li><a href="https://instagram.com/teamtreehouse" class="instagram"></a></li> </ul> <div class="stripes"></div> </footer> </section> <script type="text/javascript"> analytics.track("Viewed Search Page", {"query":"Javascript","noninteraction":true}, {"library":"analytics-wordpress"}); </script> <script type="text/javascript" id="toc-front-js-extra"> /* <![CDATA[ */ var tocplus = {"smooth_scroll":"1","visibility_show":"show","visibility_hide":"hide","visibility_hide_by_default":"1","width":"Auto"}; /* ]]> */ </script> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-content/plugins/table-of-contents-plus/front.min.js?ver=2411.1" id="toc-front-js"></script> <script type="text/javascript" id="ppress-frontend-script-js-extra"> /* <![CDATA[ */ var pp_ajax_form = {"ajaxurl":"https:\/\/blog.teamtreehouse.com\/wp-admin\/admin-ajax.php","confirm_delete":"Are you sure?","deleting_text":"Deleting...","deleting_error":"An error occurred. Please try again.","nonce":"5f00c3f264","disable_ajax_form":"false","is_checkout":"0","is_checkout_tax_enabled":"0","is_checkout_autoscroll_enabled":"true"}; /* ]]> */ </script> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-content/plugins/wp-user-avatar/assets/js/frontend.min.js?ver=4.15.21" id="ppress-frontend-script-js"></script> <script type="text/javascript" id="rocket-browser-checker-js-after"> /* <![CDATA[ */ "use strict";var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var RocketBrowserCompatibilityChecker=function(){function RocketBrowserCompatibilityChecker(options){_classCallCheck(this,RocketBrowserCompatibilityChecker),this.passiveSupported=!1,this._checkPassiveOption(this),this.options=!!this.passiveSupported&&options}return _createClass(RocketBrowserCompatibilityChecker,[{key:"_checkPassiveOption",value:function(self){try{var options={get passive(){return!(self.passiveSupported=!0)}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch(err){self.passiveSupported=!1}}},{key:"initRequestIdleCallback",value:function(){!1 in window&&(window.requestIdleCallback=function(cb){var start=Date.now();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-start))}})},1)}),!1 in window&&(window.cancelIdleCallback=function(id){return clearTimeout(id)})}},{key:"isDataSaverModeOn",value:function(){return"connection"in navigator&&!0===navigator.connection.saveData}},{key:"supportsLinkPrefetch",value:function(){var elem=document.createElement("link");return elem.relList&&elem.relList.supports&&elem.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype}},{key:"isSlowConnection",value:function(){return"connection"in navigator&&"effectiveType"in navigator.connection&&("2g"===navigator.connection.effectiveType||"slow-2g"===navigator.connection.effectiveType)}}]),RocketBrowserCompatibilityChecker}(); /* ]]> */ </script> <script type="text/javascript" id="rocket-preload-links-js-extra"> /* <![CDATA[ */ var RocketPreloadLinksConfig = {"excludeUris":"\/(?:.+\/)?feed(?:\/(?:.+\/?)?)?$|\/(?:.+\/)?embed\/|\/(index.php\/)?(.*)wp-json(\/.*|$)|\/refer\/|\/go\/|\/recommend\/|\/recommends\/","usesTrailingSlash":"","imageExt":"jpg|jpeg|gif|png|tiff|bmp|webp|avif|pdf|doc|docx|xls|xlsx|php","fileExt":"jpg|jpeg|gif|png|tiff|bmp|webp|avif|pdf|doc|docx|xls|xlsx|php|html|htm","siteUrl":"https:\/\/blog.teamtreehouse.com","onHoverDelay":"100","rateThrottle":"3"}; /* ]]> */ </script> <script type="text/javascript" id="rocket-preload-links-js-after"> /* <![CDATA[ */ (function() { "use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var t=function(){function n(e,t){i(this,n),this.browser=e,this.config=t,this.options=this.browser.options,this.prefetched=new Set,this.eventTime=null,this.threshold=1111,this.numOnHover=0}return e(n,[{key:"init",value:function(){!this.browser.supportsLinkPrefetch()||this.browser.isDataSaverModeOn()||this.browser.isSlowConnection()||(this.regex={excludeUris:RegExp(this.config.excludeUris,"i"),images:RegExp(".("+this.config.imageExt+")$","i"),fileExt:RegExp(".("+this.config.fileExt+")$","i")},this._initListeners(this))}},{key:"_initListeners",value:function(e){-1<this.config.onHoverDelay&&document.addEventListener("mouseover",e.listener.bind(e),e.listenerOptions),document.addEventListener("mousedown",e.listener.bind(e),e.listenerOptions),document.addEventListener("touchstart",e.listener.bind(e),e.listenerOptions)}},{key:"listener",value:function(e){var t=e.target.closest("a"),n=this._prepareUrl(t);if(null!==n)switch(e.type){case"mousedown":case"touchstart":this._addPrefetchLink(n);break;case"mouseover":this._earlyPrefetch(t,n,"mouseout")}}},{key:"_earlyPrefetch",value:function(t,e,n){var i=this,r=setTimeout(function(){if(r=null,0===i.numOnHover)setTimeout(function(){return i.numOnHover=0},1e3);else if(i.numOnHover>i.config.rateThrottle)return;i.numOnHover++,i._addPrefetchLink(e)},this.config.onHoverDelay);t.addEventListener(n,function e(){t.removeEventListener(n,e,{passive:!0}),null!==r&&(clearTimeout(r),r=null)},{passive:!0})}},{key:"_addPrefetchLink",value:function(i){return this.prefetched.add(i.href),new Promise(function(e,t){var n=document.createElement("link");n.rel="prefetch",n.href=i.href,n.onload=e,n.onerror=t,document.head.appendChild(n)}).catch(function(){})}},{key:"_prepareUrl",value:function(e){if(null===e||"object"!==(void 0===e?"undefined":r(e))||!1 in e||-1===["http:","https:"].indexOf(e.protocol))return null;var t=e.href.substring(0,this.config.siteUrl.length),n=this._getPathname(e.href,t),i={original:e.href,protocol:e.protocol,origin:t,pathname:n,href:t+n};return this._isLinkOk(i)?i:null}},{key:"_getPathname",value:function(e,t){var n=t?e.substring(this.config.siteUrl.length):e;return n.startsWith("/")||(n="/"+n),this._shouldAddTrailingSlash(n)?n+"/":n}},{key:"_shouldAddTrailingSlash",value:function(e){return this.config.usesTrailingSlash&&!e.endsWith("/")&&!this.regex.fileExt.test(e)}},{key:"_isLinkOk",value:function(e){return null!==e&&"object"===(void 0===e?"undefined":r(e))&&(!this.prefetched.has(e.href)&&e.origin===this.config.siteUrl&&-1===e.href.indexOf("?")&&-1===e.href.indexOf("#")&&!this.regex.excludeUris.test(e.href)&&!this.regex.images.test(e.href))}}],[{key:"run",value:function(){"undefined"!=typeof RocketPreloadLinksConfig&&new n(new RocketBrowserCompatibilityChecker({capture:!0,passive:!0}),RocketPreloadLinksConfig).init()}}]),n}();t.run(); }()); /* ]]> */ </script> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-content/themes/treehouse-blog-reboot/js/vendor/jquery.fitvids.js?ver=1.1" id="fitvid-script-js"></script> <script type="text/javascript" src="https://blog.teamtreehouse.com/wp-content/themes/treehouse-blog-reboot/js/main.js?ver=1.0.0" id="main-script-js"></script> </div> <!-- / .page-container --> </body> </html>