code: public void addJsResource(final ApplicationResource resource) {
  		WApplicationModel model = getOrCreateComponentModel();
  		if (model.jsResources == null) {
  			model.jsResources = new ArrayList<>();
  		} else if (model.jsResources.contains(resource)) {
  			return;
  		}
  		model.jsResources.add(resource);
  		MemoryUtil.checkSize(model.jsResources.size(), this.getClass().getSimpleName());
  	}
docs: Add a custom javaScript resource that is to be loaded and used by the application.
  
  @param resource the JavaScript resource