function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lukesh KarmoreLukesh Karmore 

What is the use of event.type and event.detail in js file

What is the use of event.type and event.detail ,I used it in js file in lwc 
handlesubmit(event){
console.log(event.type);
console.log(event.detail);
}
Thank You
ANUTEJANUTEJ (Salesforce Developers) 
Hi Lukesh,

event.type gives the type of event that invoked the controller method to read more about in https://developer.mozilla.org/en-US/docs/Web/API/Event/type

event.detail gives the detail but it is preferred to event.getParam("id")
event.getParam("value") as mentioned in https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/lightning_base_events.htm

It is anticipated that event.detail might be deprecated in the future as stated: 

"Although the event.detail syntax continues to be supported, we recommend that you update your JavaScript code to use the following patterns for the onselect handler as we plan to deprecate event.detail in a future release.
event.getParam("id")
event.getParam("value")"

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
Lukesh KarmoreLukesh Karmore
https://youtu.be/KCVgIauP3H8  plz  see this video and then ans thank you
ANUTEJANUTEJ (Salesforce Developers) 
I see that even in the video the event.type gives the type of event that invokes the controller method and event.details is giving details in regards to the event. 

You can also console.log event like this console.log(event); to see all the values you can check in the developer console.

Please close the thread by marking this as best answer so that it can be useful to others in the future