Hello, how to enable alerts like assignment in conditional expression in Visual Studio Code?

assignment_in_conditional_expression.jpg

Can you clarify your question? Visual Studio was correct to call out that line 2. It's incorrect for more than one reason.

Do we need to discuss the two reasons why Visual Studio called this out?
Or did you need this in some other development system?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.