Following Richard's rule of "only ever use triple-equals, never double".
const response = await fetch_post_json(`answer/${this.props.prompt.id}`, {
answers: this.answers.map(r => r.current.value)
});
const response = await fetch_post_json(`answer/${this.props.prompt.id}`, {
answers: this.answers.map(r => r.current.value)
});
- if (response.status == 200) {
+ if (response.status === 200) {
const result = await response.json();
if (! result.valid) {
add_message("danger", result.message);
const result = await response.json();
if (! result.valid) {
add_message("danger", result.message);