• 请不要在回答技术问题时复制粘贴 AI 生成的内容
TeslaM3
V2EX  ›  程序员

记录一坨代码

  •  
  •   TeslaM3 · Jul 16, 2024 · 1452 views
    This topic created in 688 days ago, the information mentioned may be changed or developed.
    function test() {
    	console.log("Hello world!");
    }
     
    (function(){
        var box = function() {
            return box.fn.init();
        };
    
        box.prototype = box.fn = {
            init : function(){
                console.log('box.init()');
    
    			return this;
            },
    
    		add : function(str) {
    			alert("add", str);
    
    			return this;
    		},
    
    		remove : function(str) {
    			alert("remove", str);
    
    			return this;
    		}
        };
        
        box.fn.init.prototype = box.fn;
        
        window.box =box;
    })();
    
    var testBox = box();
    testBox.add("jQuery").remove("jQuery");
    
    bgm004
        1
    bgm004  
       Jul 17, 2024
    要是拿这个面试我,那我可过不了。
    TeslaM3
        2
    TeslaM3  
    OP
       Jul 17, 2024
    @Track13 你想笑死我,但是我没有证据
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5800 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 02:20 · PVG 10:20 · LAX 19:20 · JFK 22:20
    ♥ Do have faith in what you're doing.