Autocompletion with custom strings

I’m creating a javascript code editor and the first feature I need is the autocompletion with custom strings. I would like to have autocompletion hints when i type “Ctrl-Space” for javascripts keywords AND custom Strings that are stocked in an array for exemple.
I would like also the hints to be filtered by the letters I have already typed, so for exemple if I have the strings [“var”, “function1”, “function2”] and I type “f”, I want the hinter to show me only function1 and function2.
Thank you for help.

By default, when there are multiple completion sources for a given mode, show-hint will use the first one that returns any completions. But it seems like you want to combine them. You could register a "hintWords" helper that contains both your custom words and the keywords you want to complete. (See the css mode for an example of registering a hint word helper.)

Thank you for your answer, but i didn’t understand, I’m a newbie and i don’t know how to use codemirror properly, I’m learning it.
The fact is that i don’t know how to get hints for javascipts keywords.
What is the css mode that you mentioned?