You need to sign in to do that
Don't have an account?
Parsing error: Unexpected token, expected ";"
In Build a Bear-Tracking App with Lightning Web Components, I am getting error Parsing error: Unexpected token, expected ";". Can't find out whats wrong.

Greetings to you!
- Please use the below code for further reference: -
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.
All Answers
Try the following:
1. Try replacing both ` with ', it looks like return 'Hello ${this.greeting.toUpperCase()}!'; , if it still doesn't then,
2. Then try adding concatnation symbols '+' after hello and before '!'. Like: return 'Hello+ ${this.greeting.toUpperCase()}+!';
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
The error was in the place where i was pasting the code.
This code worked for me:
import { LightningElement, track} from 'lwc';
export default class HelloWebComponent extends LightningElement {
@track greeting = 'Trailblazer';
handleGreetingChange(event) {
this.greeting = event.target.value;
}
currentDate = new Date().toDateString();
get capitalizedGreeting(){
return `Hello ${this.greeting.toUpperCase()}!`;
}
}
Greetings to you!
- Please use the below code for further reference: -
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha.
export default class HelloWebComponent extends LightningElement {
@track greeting = 'Trailblazer';
currentdate = new Date().toDateString();
handlegreetingchange(event){
this.greeting = event.target.value;
}
get capitalizedgreeting() {
return `Hello ${this.greeting.toUpperCase()}!`;
}