Correct Answer : navigator.connection.type
Explanation : navigator.connection.type function returns the current connection's type.
navigator.connection.type