Thus, the entire outside surface of the cell has a loose carbohydrate coat called the glycocalyx.
The carbohydrate moieties attached to the outer surface of the cell has several important functions:
Many of them have a negative electrical charge, which gives most cells an overall negative surface charge that repels other negatively charged objects.
The glycocalyx of some cells attaches to the glycocalyx of other cells, thus attaching cells to one another.
[Guyton and Hall, Textbook of Medical Physiology, 2nd South Asia Edition ( w.r.t 13e)]
Here, two contrasting statements are written. They seem to differ in the context. Actually, I tried searching for more about glycocalyx and saw the same written in many places without explanation. I cannot understand that how the cells can be attached, if both of them are negatively charged.