Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in comparing number like 121 >= 50 , expected result true but getting false #40080

Closed
mupadhyaya opened this issue Aug 17, 2020 · 2 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@mupadhyaya
Copy link

Hi there,

I found the problem while working on testing >= comparison operator. In while comparing 121 >= 50 it always return false and we can see it should be true.

Is there anything I am missing? I am using Angular 9 and I believe it is the issue related with typescript. If anywhere I am incorrect please advise me for the correction.

`import { Component, TrackByFunction } from '@angular/core';

@component({
selector: 'my-app',
templateUrl: './app.component.html',
})
export class AppComponent {

constructor(

) {}

ngOnInit() {
let value1 = "121";
let value2 = "50";
let flag = value1 >= value2; // 121 >= 50 => true
console.log(${value1} >= ${value2} expected: true, output:, flag);
}`

@MartinJohns
Copy link
Contributor

There's an issue template for bug reports. Please use it, it makes the work for the TypeScript team much easier. 👍


Related / duplicate: #36534 / #26592.

This behavior is intentional.

@RyanCavanaugh RyanCavanaugh added the Question An issue which isn't directly actionable in code label Aug 17, 2020
@mupadhyaya
Copy link
Author

There's an issue template for bug reports. Please use it, it makes the work for the TypeScript team much easier. 👍

Related / duplicate: #36534 / #26592.

This behavior is intentional.

It seems like its intentional to move towards strongly typed language. Apology for not following the bug template, just was in hurry while writing the concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants