Spreadsheet software typically uses = at the beginning of a cell to indicate a calculation should be used, and spreadsheet functions should be evaluated.
Use the && operator to add a second condition to your if statement that also checks if the first character of value is =.
My solution
const update = event => {
const element = event.target;
const value = element.value.replace(/\s/g, "");
console.log(typeof(value))
if (!value.includes(element.id) && value.startsWith('=')) {}
}
If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.
The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.
if (!value.includes(element.id) && value.startsWith('=')) {
}
Suddenly, with same code it started working, and I’m not sure why. Could someone please explain the difference between my previous code and the current code? Thank you!