learn javascript patterns