According to Wikipedia: "Namespaces provide a level of direction to specific identifiers, thus making it possible to distinguish between identifiers with the same exact name."

Also this is good article to read, and this article you should also read (focus on "Using an Object Constructor").

For example, let's say we want to have method which we will call it like my.namespace.SomeText.apply(); to achive this first we have to define my:

window.my = window.my || {};

then namespace:

window.my.namespace = window.my.namespace || {};

Don't forget semicolons otherwise you will receive error "Uncaught TypeError: object is not a function".

Whole example would go like this:

window.my = window.my || {};
window.my.namespace = window.my.namespace || {};

(function (ns) {
	var someTextModel = {
			someText: "test"
		}
	
	ns.SomeText = {
		apply: function () {
			ko.applyBindings(someTextModel)
		}
	}
}(my.namespace));

Notice that I executed function with parameter "my.namespace" which means that ns parameter of a function will be my.namespace.

HTML part looks like:

<!DOCTYPE html>
<html>

	<head>
		<script type="text/javascript" src="/knockout-3.2.0.js"></script>
		<script type="text/javascript" src="/index.js"></script>
	</head>
	
	<body onload="my.namespace.SomeText.apply();">
			Some text: <span data-bind="text: someText"></span>
	</body>

</html>

Here notice onload="my.namespace.SomeText.apply();"

Example you can see here.

---

One more example. 

JS:

window.my = window.my || {};
window.my.namespace = window.my.namespace || {};
window.my.namespace.myTest = window.my.namespace.myTest || {};

(function(ns) {
	function myTest() {
		return {
			iAm: function(param) {
				alert(param);
			}
		}
	}
	window.my.namespace.myTest = myTest;
})(window.my.namespace.myTest)

From console you can write something like:

window.my.namespace.myTest().iAm()

Example you can see here.

---

Another example. Consider following code:

window.my = window.my || {};
window.my.namespace = window.my.namespace || {};

(function () {
	var makeMyMethod = function (myMessage) {
		return {
			doTheAlert: function () {
				alert(myMessage);
			}
		};
	};

	myMethod = makeMyMethod("I am test.");
	
	window.my.namespace = {
		myMethod: myMethod
	}
	
}(window.my.namespace));

window.my.namespace.myMethod.doTheAlert();

With line of code:

window.my.namespace.myMethod.doTheAlert();

We executed method doTheAlert which we "attached" to our namespace with code:

window.my.namespace = {
  myMethod: myMethod
}

Here I wrote little bit more about namespaces.