function cookie( name , value , options  ){
      // 此时参数大于一个,value 是一个字符串。 那么我们认为此时我们在设置cookie;
      if( arguments.length > 1 && typeof value === "string"){        //判断输入的实参有几个,当至少为2个且 value的类型为string类型时执行下面语句
          if(!isObject( options )){               //如果options不为对象,令options为空对象
              options = {};
          }
          if( typeof options.expires === "number"){        
              var d = new Date();                 //对象中 expires类型为number时,获取本地时间
              d.setDate( d.getDate() + options.expires );        //设置此Cookie存在的时间
          }
          return (document.cookie = [            //往cookie中存放信息: name value domain path expires
                  name + "=" + value,
                  typeof options.domain === "string" ? ";domain=" + options.domain : "",
                  typeof options.path === "string" ? ";path=" + options.path : "",
                  typeof options.expires === "number" ? ";expires=" + d : "",
          ].join(""));                    
      }
                            //当输入实参为一个时,就是获取cookie中name的value值
      var cookie_string = document.cookie;
      var cookie_array  = cookie_string.split("; ");
      for(var i = 0 ; i < cookie_array.length ; i ++){
          if( cookie_array[i].split("=")[0] === name ){
              return cookie_array[i].split("=")[1]
          }
      }
      return "";
  }
当输入三位实参时: