How to use the second method of GLM.lm?

In the documents of GLM.lm, it says:

“In the second method, X must be a matrix holding values of the independent variable(s) in columns (including if appropriate the intercept), and y must be a vector holding values of the dependent variable.”

I want to use the second method to get same results of the first method of GLM.lm, but how to let X hold a column for the intercept? I haven’t found an example for it.

julia> X = rand(5, 3)
5×3 Matrix{Float64}:
 0.865508  0.657168   0.722091
 0.428188  0.443666   0.443288
 0.717246  0.957425   0.889641
 0.337297  0.0668421  0.500019
 0.769625  0.411271   0.811622

julia> [ones(size(X, 1)) X]
5×4 Matrix{Float64}:
 1.0  0.865508  0.657168   0.722091
 1.0  0.428188  0.443666   0.443288
 1.0  0.717246  0.957425   0.889641
 1.0  0.337297  0.0668421  0.500019
 1.0  0.769625  0.411271   0.811622

Thanks:)