You might come across a common requirement which is attempting to create a record using an LDS method.
It's not suggested to use this approach straight away, try to use one of the LDS tags to create a record. If the requirement needs a bit of customization only then rely on using this method which is createRecord.
Here is the sample code that we can use to create a record using the LDS method (which is createRecord()).
This is the template file used to capture the user input so that it can be used in creating a record.
Hope this helps!
💡
Grab your FREE course
I have put together a FREE course on Javascript that helps you master Lightning Web Components.
It just takes 2 hours to finish the course and you will be able to feel the difference.