-1

I am beginner in Web,I am new to safari browser.

I am debugging a code in safari.

I used to do some basic calculations and check some console statements in browser console during debugging.

I tried some simple codes.

But the following two statements return error in safari.

 1+1

and

console.log("I am in Safari console")

Please suggest me a solution

Please inform if any setting changes are required ?

The above statements works good in chrome,firefox,internet explorer

Community
  • 1
  • 1
Venkat
  • 2,549
  • 2
  • 28
  • 61

1 Answers1

0

You have no semicolons ; after your lines of code? Also I'm not sure what 1+1 is meant to do?

var i = 1+1;
console.log("I am in Safari console");

Can I suggest a basic Javascript learning resource such as w3schools?

Ian Grainger
  • 5,148
  • 3
  • 46
  • 72
  • Thank You for your response @ian-grainger – Venkat Jan 19 '16 at 09:20
  • ; is not must for javascript statements, The above code works fine in chrome,safari,Internet explorer – Venkat Jan 19 '16 at 09:20
  • @Venkat thank me by upvoting and accepting the answer - not by commenting! ;) It is in the middle of statements. The parser ignores whitespace, so your statement is equivalent to: `1+1console.log("I am in Safari console")`. Not brilliant, right? :) – Ian Grainger Jan 19 '16 at 09:20
  • @Venkat I see. No Safari here. Very strange that basic commands in the console don't work. You'll need to give us the error message. And try on a page that definitely doesn't have any other errors. – Ian Grainger Jan 19 '16 at 09:27