hi, samer i had an one question that when i was going through various tutorials for react, i found out strings in a state component were all written in capital letters
for eg. (reference: image uploaded)
can you please help me by telling why letters are capitalized in string in this case
It's just a common practice to do for strings that are supposed to be unique fixed values in a program. There is no syntax significance to this. You can use lower case values and things will still work.
In modern JS, you can use the "symbol" primitive type to provide unique values and it's a much better deal than using just strings (regardless of their case).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hi, samer i had an one question that when i was going through various tutorials for react, i found out strings in a state component were all written in capital letters
for eg. (reference: image uploaded)
can you please help me by telling why letters are capitalized in string in this case
onDeleteClick = async (id, dispatch) => {
try{
await
axios.delete(
https://jsonplaceholder.typicode.com/users/${id}
);and this example which i have practiced
It's just a common practice to do for strings that are supposed to be unique fixed values in a program. There is no syntax significance to this. You can use lower case values and things will still work.
In modern JS, you can use the "symbol" primitive type to provide unique values and it's a much better deal than using just strings (regardless of their case).