The Covid-19 outbreak has "forced" face-to-face teaching and learning to be entirely online. This situation also affects prospective EFL teachers in conducting teaching practicums. This study aims to analyze prospective EFL teachers using code-switching in online discussions through WhatsApp group chats. Code-switching is a popular language feature commonly used in communication. Furthermore, this research aims to identify the types of code-switching according to Poplack's theory and to find out the code-switching function based on Sert's theory. This type of research is qualitative. The subjects of this study were six prospective EFL teachers and their students. Primary data was collected from online discussions of student teachers through their WhatsApp chat groups, and then the discussions were transcribed into transcripts. The technique used to analyze the data is descriptive qualitative and quantitative analysis. The first study's results in terms of types of code-switching revealed that all participants practiced code-switching in online teaching and learning through WhatsApp group chats. The discussion provides three types of code-switching based on Poplack's theory: tag-switching, inter-sentential switching, and intra-sentential switching. Furthermore, tag switching is often used in online discussions.