I have an object that looks something like
names = {
m: [
'adam',
'luke',
'mark',
'john'
],
f: [
'lucy',
'mary',
'jill',
'racheal'
],
l: [
'smith',
'hancock',
'williams',
'browne'
]
};
I want to do it.
I get a line that looks like
{m} {l} is a masculine name, so {f} {l} is a feminine name, {r} {l} must be me / or a (random) gender name
And I want it to be randomly populated from the correct keys.
so you can get
luke browne is a masculine name, so racheal smith is a feminine name, mary browne must be either / or a (random) gender name
How should I do it?
function skeleton will look something like this:
function names(mask, callback){}
and the last line of code will look like callback(replaced)
source
share