The memristor, characterized by its nano-size, nonvolatility, and continuously adjustable resistance, is a promising candidate for constructing brain-inspired computing. It operates based on ion migration, enabling it to store and retrieve electrical charges. This paper reviews current research on synapses using digital and analog memristors. Synapses based on digital memristors have been utilized to construct positive, zero, and negative weights for artificial neural networks, while synapses based on analog memristors have demonstrated their ability to simulate the essential functions of neural synapses, such as short-term memory (STM), long-term memory (LTM), spike-timing-dependent plasticity (STDP), spike-rate-dependent plasticity (SRDP), and paired-pulse facilitation (PPF). Furthermore, synapses based on analog memristors have shown potential for performing advanced functions such as experiential learning, associative learning, and nonassociative learning. Finally, we highlight some challenges of building large-scale artificial neural networks using memristors.