Error: unexpected '}' in "}" when I write an IF ELSE code

Hello,
I'm trying to perform a simple if else, but I get an error.
This is the code

if (.Platform$OS.type="unix"){
print(10)  
}else{
  print(30)  
}

I always receive this:
Error: unexpected '}' in "}"
I know it's an issue when the bracket is closing, but I can't figure It out.
Sorry if this seems so trivial.
Thanks for your time and interest.

you have omitted an = from the test within if. comparison uses == operator.

if (.Platform$OS.type=="unix"){
print(10)  
}else{
  print(30)  
}
1 Like