Incorrect This condition will always return 'false' since JavaScript compares objects by reference, not value
warning
#60545
Labels
Won't Fix
The severity and priority of this issue do not warrant the time or complexity needed to fix it
π Search Terms
"this condition will always return false since javascript compares objects by reference typescript github issue"
π Version & Regression Information
Saw this message in vscode and the typescriptlang playground.
β― Playground Link
https://www.typescriptlang.org/play/?#code/PTAEHUFMBsGMHsC2lQBd5oBYoCoE8AHSAZVgCcBLA1UABWgEM8BzM+AVwDsATAGiwoBnUENANQAd0gAjQRVSQAUCEmYKsTKGYUAbpGF4OY0BoadYKdJMoL+gzAzIoz3UNEiPOofEVKVqAHSKymAAmkYI7NCuqGqcANag8ABmIjQUXrFOKBJMggBcISGgoAC0oACCbvCwDKgU8JkY7p7ehCTkVDQS2E6gnPCxGcwmZqDSTgzxxWWVoASMFmgYkAAeRJTInN3ymj4d-jSCeNsMq-wuoPaOltigAKoASgAywhK7SbGQZIIz5VWCFzSeCrZagNYbChbHaxUDcCjJZLfSDbExIAgUdxkUBIursJzCFJtXydajBBCcQQ0MwAUVWDEQC0gADVHBQGNJ3KAALygABEAAkYNAMOB4GRonzFBTBPB3AERcwABS0+mM9ysygc9wASmCKhwzQ8ZC8iHFzmB7BoXzcZmY7AYzEg-Fg0HUiQ58D0Ii8fLpDKZgj5SWxfPADlQAHJhAA5SASPlBFQAeS+ZHegmdWkgR1QjgUrmkeFATjNOmGWH0KAQiGhwkuNok4uiIgMHGxCyYrA4PCCJWljVl8sVSoA2gBGAC6PN5451QA
π» Code
π Actual behavior
Hovering over the line gives the warning
This condition will always return 'false' since JavaScript compares objects by reference, not value.
π Expected behavior
No warning, since the comparison results in
true
.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: