4

I have this simple a js file , which prints date continosly .

I am using Google Chrome Debugger tools (F12)

I have set a break point at the line s = date.getSeconds();

It has stopped at that break point .

My question is can i see/inspect the break point value??(if its eclipse,iwould have used Ctrl + Shift + i)

I know about the console option , but can i see value on the debugger tool ??

please see the screen shot here .

enter image description here

Thanks in advance .

function date_time(id)
{
        date = new Date;
        year = date.getFullYear();
        month = date.getMonth();
        months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'Jully', 'August', 'September', 'October', 'November', 'December');
        d = date.getDate();
        day = date.getDay();
        days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
        h = date.getHours();
        if(h<10)
        {
                h = "0"+h;
        }
        m = date.getMinutes();
        if(m<10)
        {
                m = "0"+m;
        }
        s = date.getSeconds();
        if(s<10)
        {
                s = "0"+s;
        }
        result = ''+days[day]+' '+months[month]+' '+d+' '+year+' '+h+':'+m+':'+s;
        document.getElementById(id).innerHTML = result;
        setTimeout('date_time("'+id+'");','1000');
        return true;
}

2 Answers 2

4

You can

  • hover with the mouse over the interested variables
  • open the "Scope Variables" section on the right sidebar
  • open the console ("Press Esc") and type in the variable to see its value

For instance:

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much hover with mouse i was looking for .
2

select break point variable 's' and right click on selected 's' and choose option add to watch then u can see s value in right side of Chrome Debugger window and press F10 to dibug next line.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.