Search code examples
javascriptnaming-conventionsnaming

What's different between words "target" and "dest"


I was writiing a function just copy some properties from one to another:

function copyProperties(one, another){
    //...
}

But I confused when I named those two parameters:

source and dest

or

source and target

I know this is a little ridiculous, but I still want to help...


Solution

  • dest means Destination
    target is just Target

    Definition for the word "destination" is (according to google)

    The place to which someone or something is going or being sent.

    Definition for "target" is

    An objective or result towards which efforts are directed.

    So in my opinion, you should name the paramter for this function dest, because you are copying(sending) there those properties.