<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jtwebguy</title>
    <description>The latest articles on DEV Community by jtwebguy (@jtwebguy).</description>
    <link>https://dev.to/jtwebguy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F928926%2Fea097182-4a68-473a-9416-d7dce89c9010.png</url>
      <title>DEV Community: jtwebguy</title>
      <link>https://dev.to/jtwebguy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jtwebguy"/>
    <language>en</language>
    <item>
      <title>Adding YT Video to JANA</title>
      <dc:creator>jtwebguy</dc:creator>
      <pubDate>Tue, 18 Oct 2022 06:23:09 +0000</pubDate>
      <link>https://dev.to/jtwebguy/adding-yt-video-to-jana-16dd</link>
      <guid>https://dev.to/jtwebguy/adding-yt-video-to-jana-16dd</guid>
      <description>&lt;p&gt;A while ago I created a tech/biz/gaming/entertainment news aggregator named &lt;a href="http://jana.johnboncalos.me"&gt;JANA&lt;/a&gt; which stands for just another news aggregator created in Ionic and React. Video seems just right for an addition so here's how I made it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i yt-player
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First, we need to install yt-player npm package. This does not have typings as I'm creating this with TypeScript so I generated one using &lt;a href="https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html"&gt;this&lt;/a&gt; instruction. After generating, copy your *.ts files to the root of the yt-player folder.&lt;/p&gt;

&lt;p&gt;This code below will be the main YT Frame API Component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const YTAPi = ({props, vid}:any) =&amp;gt;{
    let o:any = null
    const [player, setPlayer] = useState(o)
    const [time, setTime] = useState(0)

    useEffect( () =&amp;gt;{

            let p:any = document.querySelector('#playerMain')
            if(p == null) return

            if(player == null){
                setPlayer(new YouTubePlayer('#playerMain',{autoplay:true}))

            }else{
                player.load(vid ? vid : 'GKSRyLdjsPA')

                    player.on('cued', ()=&amp;gt;{
                        player.play()
                    })
            }

    }, [player])


    useEffect( () =&amp;gt;{

            if(player == null) return
            player.load(vid)
                    //player.setVolume(100)


                    player.on('playing', () =&amp;gt; {
                        setTime(player.getDuration()) // =&amp;gt; 351.521
                    })

                    player.on('ended', ()=&amp;gt;{
                        //alert('ended')
                    })
                    player.on('cued', ()=&amp;gt;{
                      player.play()
                  })

    }, [vid])

    return (
        &amp;lt;&amp;gt;
        &amp;lt;div id="playerMain" className="mainPlayer"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/&amp;gt;
    )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "{props,vid}" arguments take object and a video ID string so we can play other videos as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RmDs_Z6X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jo8f7z5an92biu4hi7e5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RmDs_Z6X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jo8f7z5an92biu4hi7e5.png" alt="Image description" width="880" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>typescript</category>
      <category>youtube</category>
      <category>react</category>
    </item>
    <item>
      <title>JANA in 3 days - PWA with Ionic +Capacitor + React</title>
      <dc:creator>jtwebguy</dc:creator>
      <pubDate>Fri, 14 Oct 2022 04:35:40 +0000</pubDate>
      <link>https://dev.to/jtwebguy/jana-in-3-days-pwa-with-ionic-capacitor-react-46lf</link>
      <guid>https://dev.to/jtwebguy/jana-in-3-days-pwa-with-ionic-capacitor-react-46lf</guid>
      <description>&lt;p&gt;I present to you: &lt;a href="http://jana.johnboncalos.me"&gt;JANA&lt;/a&gt; - my "Just Another News Aggregator" app created only after 3 days of coding in Ionic and React using &lt;a href="https://capacitorjs.com/"&gt;Capacitor&lt;/a&gt; Plugins. The process was without a sweat. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sYuNVwJA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f7cpgexgetrhmsdpe91t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sYuNVwJA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f7cpgexgetrhmsdpe91t.png" alt="Image description" width="500" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JANA is just a simple news aggregator with the articles coming from various RSS feeds. I decided not to display images to make it more readable and add to the simplicity and it's dark mode in default. I also decided not to collect user data but allow them to filter news sources in the settings menu and the data will be stored in the app itself using Capacitor's "Preferences" plugin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YevyV_KB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5hgyn4axv9iv4e51hwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YevyV_KB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5hgyn4axv9iv4e51hwu.png" alt="Image description" width="880" height="1809"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ionic's straightforward components are much easy to use with the helpful docs at your disposal. Along with Capacitor which deals with native android and iOS part you'll have a smooth sailing building your first progressive web app. The documentation is well written and super understandable.&lt;/p&gt;

</description>
      <category>pwa</category>
      <category>ionic</category>
      <category>react</category>
      <category>capacitor</category>
    </item>
    <item>
      <title>Dance to the beat: ThreeJS Drum Set</title>
      <dc:creator>jtwebguy</dc:creator>
      <pubDate>Mon, 03 Oct 2022 22:15:48 +0000</pubDate>
      <link>https://dev.to/jtwebguy/dance-to-the-beat-threejs-drum-set-2hmc</link>
      <guid>https://dev.to/jtwebguy/dance-to-the-beat-threejs-drum-set-2hmc</guid>
      <description>&lt;p&gt;Just wanted to share with you my latest toy: &lt;a href="https://johnboncalos.me/drumset/"&gt;ThreeJS Drum Set&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Made with: &lt;a href="https://threejs.org/editor/"&gt;ThreeJS Editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drum model from Vaclav Marena &lt;a href="https://sketchfab.com/3d-models/drum-kit-for-your-band-afd79a4ba8fc4cd18971e125c772a565"&gt;sketchfab&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drum Sounds from various Sound repos:&lt;br&gt;
&lt;a href="https://soundcamp.org/"&gt;soundcamp.org&lt;/a&gt;&lt;br&gt;
&lt;a href="https://bigsoundbank.com/"&gt;bigsoundbank.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.fesliyanstudios.com/"&gt;fesliyanstudios.com&lt;/a&gt;&lt;br&gt;
&lt;a href="https://freewavesamples.com"&gt;freewavesamples.com&lt;/a&gt;&lt;br&gt;
Thanks muchos!&lt;/p&gt;

&lt;p&gt;x&lt;/p&gt;

</description>
      <category>threejs</category>
      <category>drumset</category>
      <category>music</category>
    </item>
    <item>
      <title>Trippy 8D audio with ThreeJS Editor.</title>
      <dc:creator>jtwebguy</dc:creator>
      <pubDate>Fri, 30 Sep 2022 11:06:54 +0000</pubDate>
      <link>https://dev.to/jtwebguy/8d-audio-with-threejs-editor-25o7</link>
      <guid>https://dev.to/jtwebguy/8d-audio-with-threejs-editor-25o7</guid>
      <description>&lt;p&gt;We will try to make an 8D audio effect with ThreeJS editor. An 8D music is produced by adding panning, reverb and other sound effects to the audio file but here we'll create a dynamic 8D audio effect using threeJs "THREE.PositionalAudio" object.&lt;/p&gt;

&lt;p&gt;First, fire up the threeJs editor found &lt;a href="https://threejs.org/editor/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Add A box object and attach a script to it on the lower right corner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylcwcmnlccwtuvrbfyjp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fylcwcmnlccwtuvrbfyjp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, add a sphere or any 3d object you want it does not matter and set its position to the right of the box about 2 units. Now, we need to make it a child of the box by dragging the sphere handle under the box handle on the SCENE tree view on the upper right corner of the editor. Add a script to the sphere 3d object like what we did on the box 3d object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprjidgqs08eutmcy1a5r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprjidgqs08eutmcy1a5r.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Box (parent) script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;player.listener = null

var tOld = 0
var rotX = 1
var rotY = 1
var rotZ = 1

function update( event ) {
    var ds = new Date().getSeconds()

    var dn = Date.now()

    if(tOld &amp;lt; dn) {

        tOld = dn+5000

        rotX = ds % 4 == 0 ? 1 : 0

        rotY = ds % 3 == 0 ? 1 : 0

        rotZ = ds % 2 == 0 ? 1 : 0

        console.log(rotX, rotY, rotZ)

        console.log(tOld, dn, ds)

    }

    this.rotateOnAxis(new THREE.Vector3(rotX,rotY,rotZ), deg2rad(.1))


}

function init(){

    player.listener = new THREE.AudioListener();
    console.log(player)
    this.add(player.listener)


}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First we set the player.listener to null then on the init hook we set the THREE.audioListener to the player.listener so it can be accessible on the sphere script child.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function init(){

    player.listener = new THREE.AudioListener();
    console.log(player)
    this.add(player.listener)


}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we initialize tOld, rotX, rotY, rotZ. We will use this later for our random rotations. We get the current seconds from the Date() class and the current milliseconds from Date.now() function.&lt;/p&gt;

&lt;p&gt;If the old time (tOld) is still greater than the new milliseconds, do not adjust the rotation settings. This will renew every 5 seconds.&lt;/p&gt;

&lt;p&gt;Finally, we rotate the box 3d object.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;this.rotateOnAxis(new THREE.Vector3(rotX,rotY,rotZ), deg2rad(.1))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Sphere  script:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function init(){
    console.log('ball', player)

    var i = setInterval( () =&amp;gt; {

        if(player.listener === null) return

        player.sound = new THREE.PositionalAudio( player.listener );

        this.add(player.sound)


        const audioLoader = new THREE.AudioLoader();
        audioLoader.load( 'https://cdn.jsdelivr.net/gh/ellenprobst/web-audio-api-with-Threejs@57582104/lib/TheWarOnDrugs.m4a', function( buffer ) {
            player.sound.setBuffer( buffer );
            player.sound.setLoop( false );
            player.sound.setVolume( 1 );
            player.sound.play();
        });
        console.log('loaded sound!')

        if(player.listener !== null){
            clearInterval(i)
        }   

    }, 1000)

}


function stop(){
    player.sound.stop()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What the script does: &lt;/p&gt;

&lt;p&gt;On init hook, we set player.listener global variable to THREE.PositionalAudio onto player.sound which is gonna be another global variable. We need this so we can stop the audio on stop hook. then load the audio file and set its buffer, loop, volume and finally play it.&lt;/p&gt;

&lt;p&gt;Now you can enjoy 8D positional audio with your own mp4 or ogg music files. &lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="http://www.johnboncalos.me/8daudio/" rel="noopener noreferrer"&gt;demo!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>8d</category>
      <category>threejs</category>
      <category>8dmusic</category>
    </item>
    <item>
      <title>Test your PHP</title>
      <dc:creator>jtwebguy</dc:creator>
      <pubDate>Mon, 26 Sep 2022 04:29:06 +0000</pubDate>
      <link>https://dev.to/jtwebguy/test-your-php-237d</link>
      <guid>https://dev.to/jtwebguy/test-your-php-237d</guid>
      <description>&lt;p&gt;Got these tests from recent interviews and thought it to share with everyone to once in a while measure your PHP skill level.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Check if Parentheses, Brackets and Braces Are Balanced. It's better to use Stacks method but use your own if you must.
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;'{{}}' = Pass&lt;br&gt;
'[]}{{}}' = Fail&lt;br&gt;
'[[{]{{}}' = Fail&lt;br&gt;
'[]()(' = 1x open parenthesis/bracket/curly brace&lt;br&gt;
'[]({{{{{{{{{{{{{{{{{}}}}}}}}}})' = Too many open&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Unique names
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;$names = unique_names(['Ava', 'Emma', 'Olivia'], ['Olivia', 'Sophia', 'Emma']);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;// should print Emma, Olivia, Ava, Sophia&lt;br&gt;
function unique_names(array $array1, array $array2) : array&lt;br&gt;
{&lt;br&gt;
   //todo: your code here&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Find the roots in any order
&lt;/h1&gt;

&lt;p&gt;For example: findRoots(4, 12, 8); //[-1,-2] or [-2,-1]&lt;/p&gt;

&lt;p&gt;root formula&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xD2GB2i_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4l6mtddi9nd8m7hbwk0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xD2GB2i_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4l6mtddi9nd8m7hbwk0.png" alt="Image description" width="125" height="67"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@return array An array of two elements containing roots in any order&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function findRoots($a, $b, $c)&lt;br&gt;
{&lt;br&gt;
    //todo: your code here&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Fibonacci Sequence
&lt;/h1&gt;

&lt;p&gt;Write a code that will get the Fibonacci sequence number starting from #1 up to n numbers.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;should print:&lt;br&gt;
1 1 2 3 5 8 13....n&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Post your code in the comments. &lt;/p&gt;

</description>
      <category>php</category>
      <category>phpskills</category>
      <category>phptest</category>
    </item>
    <item>
      <title>JavaScript: Closure, variables &amp; hoisting</title>
      <dc:creator>jtwebguy</dc:creator>
      <pubDate>Thu, 22 Sep 2022 12:40:17 +0000</pubDate>
      <link>https://dev.to/jtwebguy/javascript-closure-variables-hoisting-1c9a</link>
      <guid>https://dev.to/jtwebguy/javascript-closure-variables-hoisting-1c9a</guid>
      <description>&lt;p&gt;&lt;strong&gt;Closure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I will try to get a shot at explaining these three things because these are mostly asked during interviews so hang around a bit.&lt;/p&gt;

&lt;p&gt;Closure is, to simply say is the boundary of each function on JavaScript between the two curly braces or "mustaches" for its own variables.&lt;/p&gt;

&lt;p&gt;Consider this example.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let name = 'Sally';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function greeting() { &lt;br&gt;
    let message = 'Hi';&lt;br&gt;
    console.log("Greeting:",  message + ' '+ name);&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That function will log "Hi Sally" because "name" is a global variable and it is accessible inside the function. &lt;/p&gt;

&lt;p&gt;But if you try:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let name = 'Sally';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;function greeting() { &lt;br&gt;
    let message = 'Hi';&lt;br&gt;
}&lt;br&gt;
console.log("Greeting:",  message + ' '+ name);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will put out "ReferenceError: message is not defined" error because the message variable is not referenced outside of its enclosing function. No leaking out it is.&lt;/p&gt;

&lt;p&gt;You can find more advanced closure explanations [here].(&lt;a href="https://www.javascripttutorial.net/javascript-closure/"&gt;https://www.javascripttutorial.net/javascript-closure/&lt;/a&gt;) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variables in JavaScript are just like any variables in other language but much more simple. It is declared by using "var", "const" or "let" keywords.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;var&lt;/strong&gt; is the oldest kid in the JS world. It can hold any variable type and can be changed inside a function when declared globally but it cannot be referenced outside its parent function. (See closure above) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;const&lt;/strong&gt; is a variable that cannot be changed throughout your code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;let&lt;/strong&gt; is block scoped to the function, expression or statement that is used.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for(let i=0; i&amp;lt;10; i++){&lt;br&gt;
    console.log(i)&lt;br&gt;
}&lt;br&gt;
console.log(i)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The variable "i" in the above for loop will console.log fine but outside it will be undefined.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for(var i=0; i&amp;lt;10; i++){&lt;br&gt;
    console.log(i)&lt;br&gt;
}&lt;br&gt;
console.log(i)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Using "var" instead of "let" lets you use "i" outside the loop so it has some uses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hoisting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MDN says: &lt;br&gt;
JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the top of their scope, prior to execution of the code. Hoisting allows functions to be safely used in code before they are declared.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.log(i); //undefined&lt;br&gt;
var i=0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Considering the code above, log will output undefined because the variable was hoisted up prior to execution.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.log(i); //ReferenceError: can't access lexical declaration 'i' before initialization&lt;br&gt;
let i=0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.log(i); //ReferenceError: can't access lexical declaration 'i' before initialization&lt;br&gt;
const i=0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Hoisting does not work for const or let keywords so keep that in mind.&lt;/p&gt;

&lt;p&gt;That's it for now folks! Happy coding.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Can old dogs learn new tricks?</title>
      <dc:creator>jtwebguy</dc:creator>
      <pubDate>Wed, 21 Sep 2022 13:02:47 +0000</pubDate>
      <link>https://dev.to/jtwebguy/can-old-dogs-learn-new-tricks-112n</link>
      <guid>https://dev.to/jtwebguy/can-old-dogs-learn-new-tricks-112n</guid>
      <description>&lt;p&gt;Back then, the web universe was very simple. Just a bunch of tools here and there and jQuery was the new black and it was a mess. I was coding in Notepad++ the entire 9 years! WordPress was dominating the blogger sphere and it turned into a swiss-army knife of some sort and now turning into a big pile of cow dung.  &lt;/p&gt;

&lt;p&gt;Today there's a dizzying array of IDEs, Frameworks and everything coder boys want to get their hands into. SPAs are white hot and JS frameworks are popping up like mushrooms.   &lt;/p&gt;

&lt;p&gt;To be honest I let myself cruise along. Happy go lucky. I was earning a decent amount for me and my kids so I was flipping WP sites without ever touching Angular or React and I am paying the price. Competitiveness was thrown out the window.&lt;/p&gt;

&lt;p&gt;I'm turning 39 next month and boy I feel old. I've been in the Web Dev business for almost 14 years to date. Started as a junior PHP and now tinkering with these fancy JavaScript toys. I've successfully rebuilt a site from AngularJS to Angular 11 (that's not a very pleasant experience) and I'm now playing around with react and hopefully finish up my craiglist-esque website.&lt;/p&gt;

&lt;p&gt;I need to re-learn JavaScript fast. Yes, I can cough up a decent JS code but it's not enough. Questions like "What is the event loop" or "What is shadow DOM" are most likely to be asked during interviews. Like seriously there are those now?&lt;/p&gt;

&lt;p&gt;With luck I found frontendinterviewhandbook.com and trying to get eloquent enough with JS and teach this old dog some new tricks.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
