Prefab instead of class oClass = new class() ?

Hey, in some javascript - canvas game engine when wanted to create a bullet object I simply did:
class oClass = new class().
Can I do it in unity as I wrote ? Or to make a new object I need to have a prefab and then I create instances of it when I want to shoot ?

If i understand your question correctly.

It’s a good idea to attach a gameobject/transform to a script variable of the same type. This would be your prefab.

You would instantiate the prefab as the bullet. Later if performance is an issue and depending on how you want to use it, you may want to use a objectpool system. You can look these things up on google and find a ton of examples and code.