JS for loop questions about variable types

  node.js, question
<script>
 var num = 100;
 for (var i=num-5;  I<num plus 5;  I plus)
 // console.log(typeof(i));
 console.log("i");
 bracket
 </script>

This code console will output I 10 times;

<script>
 var num = "100";
 for (var i=num-5;  I<num plus 5;  I plus)
 // console.log(typeof(i));
 console.log("i");
 bracket
 </script>

This code will output hundreds of I’s; It’s Why? ? The difference is only that the variable num is assigned a string or a number.

Because “100”-5 is 95, and” 100 “plus 5 is 1005