How do you use a server side variable as a client side element?

var clientSideVar = <%=serverSideVar%>; // if it's number

var clientSideVar = '<%=serverSideVar%>'; // if it's string

var clientSideVar = <%=serverSideVar.ToString().ToLower()%>; / if it's boolean