taskengine.js
function addTask(taskData, subTaskData) {
			var subTaskList,
				parsedData,
				subTask = false;

			if(taskData !== undefined) {
				if(parseInt(taskData,10) > -1) {
					subTaskList = this.getTaskByID(parseInt(taskData,10)).subTasks;

					parsedData = this.parseInputData(subTaskData);
					subTask = true;
				}
				else {
					parsedData = this.parseInputData(taskData);
				}


				var newTask = _.clone(defaultTask)
				_.extend(newTask, parsedData);

				newTask.dateAdded = Date.now();
				newTask.id = largestID + 1;
				newTask.subTask = subTask;

				this.tasks.unshift( newTask );

				if(subTask) {
					subTaskList.push(newTask.id);
				}

				console.log('Added:');
				return newTask;
			}
			else {
				console.log('no task name given');
				return false;
			}

		}
function addTask(taskData, subTaskData) {
			var subTaskList,
				parsedData,
				subTask = false;

			if(taskData !== undefined) {
				if(parseInt(taskData,10) > -1) {
					subTaskList = this.getTaskByID(parseInt(taskData,10)).subTasks;

					parsedData = this.parseInputData(subTaskData);
					subTask = true;
				}
				else {
					parsedData = this.parseInputData(taskData);
				}


				var newTask = _.clone(defaultTask)
				_.extend(newTask, parsedData);

				newTask.dateAdded = Date.now();
				newTask.id = largestID + 1;
				newTask.subTask = subTask;

				this.tasks.unshift( newTask );

				if(subTask) {
					subTaskList.push(newTask.id);
				}

				console.log('Added:');
				return newTask;
			}
			else {
				console.log('no task name given');
				return false;
			}

		}
function addTask ( taskData , subTaskData ) { var subTaskList , parsedData , subTask = false ; if ( taskData !== undefined ) { if ( parseInt ( taskData , 10 ) > - 1 ) { subTaskList = this . getTaskByID ( parseInt ( taskData , 10 ) ) . subTasks ; parsedData = this . parseInputData ( subTaskData ) ; subTask = true ; } else { parsedData = this . parseInputData ( taskData ) ; } var newTask = _ . clone ( defaultTask ) _ . extend ( newTask , parsedData ) ; newTask . dateAdded = Date . now ( ) ; newTask . id = largestID + 1 ; newTask . subTask = subTask ; this . tasks . unshift ( newTask ) ; if ( subTask ) { subTaskList . push ( newTask . id ) ; } console . log ( 'Added:' ) ; return newTask ; } else { console . log ( 'no task name given' ) ; return false ; } }
Add the given task to our array

@param taskData
@param callback
@return {undefined}
Add the given task to our array