javascript function feature extractor