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

Yet Another Odd TS Warning #613

Closed
curran opened this issue Mar 25, 2024 · 0 comments
Closed

Yet Another Odd TS Warning #613

curran opened this issue Mar 25, 2024 · 0 comments

Comments

@curran
Copy link
Contributor

curran commented Mar 25, 2024

image

// Split the text into lines
  const lines = text.trim().split('\n');

  // Initialize an empty array to store the data
  const data = [];

  for (let i = 1; i < lines.length; i++) {
    const [Month, High, Temp, Low] = lines[i].split(',');
    console.log(Month, High, Temp, Low); // Debugging
    data.push({
      Month: Month.trim(),
      High: +High.replace('°F', '').trim(),
      Temp: +Temp.replace('°F', '').trim(),
      Low: +Low.replace('°F', '').trim(),
    });
  }
  // Ensure data parsing
  console.log(data); // Debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant