Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const calculateRisk = (ticket) => dispatch => {
- const numberOfComments = ticket.comments.length
- let riskByComments//if i use const i need to declare its value
- //right away, i cannot use an if statement to do it later
- if(ticket.comments.length>2){
- riskByComments=5//if i use const inside the if statement
- }else{
- riskByComments=0//i cannot use it in the rest of my function
- }
- const riskByComments = ticket.comments.length>2 ? 5 : 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement