Remove ( var ) declarations #1506
Replies: 2 comments 1 reply
-
This is just a suggestion, not based on complete knowledge of the Mojo programming language 🔥 I'm just a novice programmer. If anyone has any comments on this suggestion, you can discuss it here. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Right, let's discuss this in 1456 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
You could remove the keyword ( var ) Why don't we simplify things?
var a: String = "Hello Mojo 🔥" ❌
a: String = "Hello Mojo 🔥" ✅. # Here Mojo Compiler 🔥 will recognize the type of the
variable at compile time
If you write the variable type as we explained in the previous example, the variable type will be recognized at compile time. If you do not write the variable type, the variable type will be recognized at run time For example
a = "Hello Mojo 🔥" ✅ # here Mojo Compiler 🔥 will recognize the type of the variable
at runtime
Beta Was this translation helpful? Give feedback.
All reactions