We propose the use of the extreme learning machine in programming by demonstration. Some advantages of this technique are a fast training phase and avoiding falling in local minima. We present two ways of using it: (i) for encoding one or several trajectories of a demonstration and (ii) for learning the direct kinematic model of a robot, which once known, allows changing the final position of the demonstrated trajectory. Through comparison with other commonly used techniques, it is experimentally shown that this technique has the lowest learning time and the second lowest error. Also, using a real robot, the learning of the kinematic model was tested, reaching the final position even when this is different to the final of the demonstrated trajectory.