iOS Swift Basics Swift Operators Working With Operators: Part 2

CJ Doyle
CJ Doyle
1,042 Points

What am I doing wrong? Should I use initialScore = initialScore + 1

var initialScore = 8 initialScore = +=1

operators.swift
// Enter your code below

var initialScore = 8
initialScore = +=1

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 44,784 Points

The unary plus operator is += not = += so you'd have:

initialScore +=1
CJ Doyle
CJ Doyle
1,042 Points

I didn't even realize I was the assignment operator there. Thank you smh