Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between let, const, and var?



What is the difference between let, const, and var?..

Answer / glibwaresoftsolutions

Keyword Scope Can be reassigned? Hoisted?
var Function-scoped Yes Yes (initialized as undefined)
let Block-scoped Yes No
const Block-scoped No No

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

i want to display time using hidden variable in a page,but when i click button that page that hidden variable loosing its value.i m sending the code also. <script type="text/javascript" language="javascript"> var tick=0; window.onload = function() { //debugger if(document.getElementById("hdnTicker").value != "") tick = parseInt(document.getElementById("hdnTicker").value); setInterval("Timer()",1000); } function Timer() { //debugger document.getElementById("hdnTicker").value = tick++; //alert(document.getElementById("hdnTicker").value); document.getElementById("lblTimeSpent").innerHTML = "0." + tick; if(tick == 30) { //message or redirect to result window alert('time is out'); //clearTimeout(); } } </script> <form id="form1" runat="server"> <div> <table> <tr> <td> <asp:Label ID="lblTimeSpent" runat="server" Visible="true" ForeColor="Blue" ></asp:Label> </td> <td> <%-- <asp:textbox EnableViewState="true" id="hdnTicker" runat="Server" style="visibility:hidden"></asp:textbox>--%> </td> </tr> <tr> <td> <asp:Button ID="btn" runat="server" Text="hi" OnClick="btn_Click" Height="30px" Width="60px" /> </td> </tr> </table> <%--<asp:HiddenField ID="txt" runat="server" Visible="true" />--%> </div> </form> <input type="hidden" id="hdnTicker" name="hdnTicker" enableviewstate="true" runat="server" />

1 Answers  


What is the difference between synchronous and asynchronous JavaScrip

1 Answers  


How do you write an if statement in javascript?

0 Answers  


Which built-in method returns the characters in a string beginning at the specified location?

0 Answers  


How do I save javascript?

0 Answers  


What is the instanceof operator in JavaScript?

0 Answers  


How do you round a value in javascript?

0 Answers  


How to set the focus in an element using javascript?

0 Answers  


Write sample code for pagination using java script.

3 Answers  


What is built in function in javascript?

0 Answers  


What is the difference between programing language and scripting language.?

3 Answers   Reliance, TCS,


What are the types used in javascript?

0 Answers  


Categories