In javascript I have found some variable declaration without the 'var'
keyword for example -
<script type="text/javascript">
userId
</script>
Then I think javascript may be a dynamically typed language like - python
.
But in some other place found some variable declaration with the keyword'var'
like -
<script type="text/javascript">
var accountNumber
</script>
Since I am new in Javascript
it's somewhat confusing to me. What's the diffrence between these 2 declaration. Does the scope of these two declared variable remain same?
Thanks